Linux SSH commands to show and monitor server resources and real-time performance: memory, swap, disk usage, CPU usage and I/O

Below are a few general commands found in most popular Linux distros which you can use via SSH to check the status of your hosting server.

To show used and available RAM memory and swap space usage:

free -m

To show current disk storage usage by mounted device:

df

To show disk usage statistics of the current directory by directories and files:

du

To show the hard disk space a directory or a file takes up:

du filename

To show the length of time this server has been up and the server loads in the past 1 minute, 5 minutes and 15 minutes:

uptime

To display a real-time updated server resource usage including: server uptime, user logged on, load average, current tasks, CPU usage, memory usage and swap usage:

top

To display a list of real-time active or sleeping processes your server is up to:

ps

To show some information about the current status of virtual memory, CPU usage, I/O usage:

vmstat

This is also a good tool to find out system performance bottlenecks.

To display currently logged on users on the system:

w

Or

who

To print a full screen text graph of the server load refreshed every few seconds:

tload

If you are on shared hosting, chances are your server usage has been imposed some hard limits such as the largest amount of files / directories possible and the hard storage limit. View them by:

quota