Commands used in SSH to view disk size and usage in server:-

There many reasons that you are not able to login your server WHM or cpanel to know the status of your website when it is not loading or running slow like that.This may be caused due to the disk space usage is already full.To know the usage of disk follow the below instructions ,how to view the desk space and usage in SSH.

View disk size and usage through SSH.

1.Login /Access SSH

2.Enter the below command that will show the results of the disk information in bytes.

 df

3.And to check the total amount of disk space for the server, used and available disk space in gigabytes, type in the following command:

 df -h

4. And to check the total amount of disk space for the server, used and available disk space in kilobytes, type in the following command:

 df -k

5. If you want to check the total amount of disk space you have for the server, used and available disk space in megabytes, type in the following command:

 df -m

6.If you want to check the file system inodes, type in the following command:

 df -i

7.If you want to check the file system type of your system, use the following command:

 df -T

8. You can check disk usage by using the du command. This is most useful for a specific hosting account or a cPanel account.

 du  /home/cPanel_username/public_html

9.The du -h command shows results in “Human Readable Format“ – sizes in Bytes, Kilobytes, Megabytes, Gigabytes etc. This will give you more specific results with the size of the file and its directory path.

 du -h /home/cPanel_username/public_html

You may also use this for a specific folder.

 du -h /home/cPanel_username/public_html/specific_folder

10.The command du -sh will show the disk usage summary of the directory.

 du -sh /home/cPanel_username/public_html

11.The du –max-depth=1 command

This can also be sorted using the command below:

 du --max-depth=1 | sort -n | awk 'BEGIN {OFMT = "%.0f"} {print $1/1024,"MB", $2}'