Today we will discuss about linux commands which is very useful for Linux system admin. There are many commands in linux but going to mention some commands which is mostly used in Hosting industry for linux.

TOP

The top command provides a real-time view of a running system. This is best command for
linux admins to check server load, uptime etc.. There are many switches in top commands but
mostly used switch is “-c” which shows actual path  of each process.

top -c

 

Similarly if you want to track specific user process you can use

top -u cpanelusername

 


Kill

This command is very helpful to terminate any process without reboot system.
kill -9 is my best command to terminate any process.

Example : kill – 9 <pid >

It will terminate only particular process You can find pid ( Process id ) by using command.
For example if you want to know process id (pid ) of mysql so you can use

ps ax | grep mysql
 

If you want to kill all child and parent process so you can use

killall < process name >
Example:- #killall httpd

 


cPanel commands 

We can suspend and unsuspend accounts via command line using those cPanel scripts.

 

To suspend cPanel account

/scripts/suspendacct cpanelusername

To unsuspend cPanel account

/scripts/unsuspendacct cpanelusername

To check cPanel Version installed on server.

/usr/local/cpanel/cpanel -V

Backup cPanel account:

/scripts/pkgacct cpanelusername

This command will take few minutes ( it’s depend upon disk usage of cpanel account ) to complete and create a backup file under /home directory with name /home/cpmove-cpanelusername.tar.gz

Restore cpanel account

/scripts/restorepkg cpanelusername

This command will restore full account with all settings, files, email id and databases.

To remove backup of cpanel users

for user in `/bin/ls -A /var/cpanel/users` ; do rm -fv /home/$user/backup-*$user.tar.gz ; done

If  backup wizard option is enabled so user will create backup. You can remove all backup file by using above command.

Don’t forget to drop your feedback in the comments section below if you found this article helpful.