January 19, 2017 Design 0

Without over complicating things, here is a list of useful SSH commands that I’m using to remotely manipulate the server of my websites.

  • du -msh  /home/directory_name/public_html/  – This will show you the size of the selected directory (this can take quite a while if you have many files in the directory, even hours! be patient)
  • ls -l  – this will list all your directories at the current location
  • cd /home – obviously, this will change the directory where you are
  • service mysql restart  – restart the mysql server
  • swapoff -a – this will turn swap off (be patient, it can take a while)
  • swapon -a – this will turn swap back on. It’s a good way to clear the swap – turn it off first (above cmd), and then turn it back on
  • free -m – this will show you the free memory available in the system

There we go, this was short and useful, wasn’t it?

I’ll keep on adding more useful  linux SSH commands as I’m using them. I hope this was helpful 🙂