Guide on how to know the detailed number of inodes via SSH

How to check the number of inodes

If you are using a hosting service that supports the use of SSH, you can find out the details of disk inodes usage via SSH.

After logging into SSH, type the following inodes check command:

find . -printf "%h\n" | cut -d/ -f-2 | sort | uniq -c | sort -rn


View:




When you first login, you will enter the home directory. The above command is run on the home directory in the Hosting account. If you want to check the details of the use of inodes in the folder inside, for example public_html, then you can enter the folder first by typing the command:

cd public_html

After that, run the inodes checking command again as above, it will show the use of inodes in each folder in public_html as shown in the following image:



If you want to return to the previous directory, type the command:

cd ..

Description

If your hosting account is full of disk quota or inodes, then when running the above command, the following error will appear:

sort: cannot create temporary file in ‘/tmp’: Disk quota exceeded

Don't panic, please try again but use the commands below:

echo "Inode usage for: $(pwd)" ; for d in `find -maxdepth 1 -type d |cut -d\/ -f2 |grep -xv . |sort`; do c=$(find $d |wc -l) ; printf "$c\t\t- $d\n" ; done ; printf "Total: \t\t$(find $(pwd) | wc -l)\n"

This is the guide to find out the number of inodes on hosting via SSH, hopefully useful!

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.