Académique Documents
Professionnel Documents
Culture Documents
_m=knowledgebase&_a=viewarticle&kbarticleid=50
SSH Commands
Author:
DonBiz Hosting Company
Created On: 03 Sep 2009 02:51 AM
I. Basic Commands
cd /path/to/directory/
ls -alh
D. Checking Processes
ps -a top -c
ps -auxf
(process list)
E. Start/Stop Services
/etc/init.d/ start|stop|restart|status
cat /proc/user_beancounters
df
Page 1/4
Powered By Kayako SupportSuite
https://www.donbiz.net/support/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=50
du
du -sh
rm -vf
(force-deletes file. Dont run unless you know EXACTLY what you're doing)
rm -vrf
rmdir
cp filename.abc /new/path/filename.abc.123
mv filename.abc /new/path/filename.abc.123
touch filename.123
Page 2/4
Powered By Kayako SupportSuite
https://www.donbiz.net/support/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=50
Anytime a user creates a file, the Ownership of the file matches that user. In Plesk, every domain
that has hosting has a different user. So if you are copying files from one domain to another, you
must remember to change ownership.
IV. Checking Log Files (dv)
Log files can tell you a lot about whats going on on a (dv). You can use the command:
'tail -n 100' before the logfile name to list the last 100 entries of the logfile.
/var/log/messages
/var/log/httpd/error_log
(main)
/home/httpd/vhosts/mt-example.com/statistics/logs/error_log
C. MySQL Logs
/var/log/MySQLd.log
D. Mail Logs
Page 3/4
Powered By Kayako SupportSuite
https://www.donbiz.net/support/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=50
/usr/local/psa/var/log/maillog
NOTE:
* The main error log will not always give you all the information you want for a svc.
* You may see alot of failed SSH and FTP connections, that is generally normal.
* Keep an eye out for MaxClients errors in the Apache logs if a customer is complaining of
Apache dying alot. You can check the KB for raising MaxClients settings.
* If a customer does not set up Log Rotation for a domain under Plesk, then Log Files will build
up and may take up alot of unneeded space. You can usually delete old log files in Plesk, and
change the Log Rotation to Daily instead of by size.
* MailLogs can show you if a customer is spamming, or if mail is coming in or out.
* MySQL Logs should be able to show you general MySQL errors such as bad connections, or
corrupted tables. Check the Int. KB for the 'myisamchk -r' repair table command.
V. Advanced Commands
A. Find. You can do alot with find. for now lets find all files over 10MB.
cd /
find / -type f -size +10000k -exec ls -lh {} ; | awk '{ print $5 ": " $9 }' |sort -n
C. Less/More
less filename.abc
more == same thing basically. You can use the '| more' command to scroll through something page
or line at a time.
vi /path/to/filename.abc
Page 4/4
Powered By Kayako SupportSuite