How to view disk size and usage

There may be instances that you are not able to access cPanel and/or WHM or your website may be running slow. This may be caused by the disk space usage that is already full. Follow the instructions below on how to view disk size and usage.

(Note: For Virtual Private Servers and Dedicated Server Hosting packages only.)

View disk size and usage through SSH

Step 1. Access SSH (Windows PC) (MAC OSx).

Step 2. The df command will show you results of the disk information in bytes.

df

df-command-ssh

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

df -h

check-disk-usage

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

df -k

 df-k-command-ssh

2.3. 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

df-m-command-ssh

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

df -i

df-i-command-ssh

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

df -T

df-t-command-ssh

Step 3. 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

du-command-ssh

3.1. 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

 du-h-command-ssh

You may also use this for a specific folder.

du -h /home/cPanel_username/public_html/specific_folder

du-h-command-folder

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

du -sh /home/cPanel_username/public_html

du-sh-command-ssh

3.3. The du –max-depth=1 command

du-max-depth-command-ssh

This can also be sorted using the command below:

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

check-files-and-usage file-size-ssh

Do not hesitate to contact our support team if you have further questions.

View disk size and usage

Leave A Comment?