How to find inode usage of a cPanel account

For most of the hosting service accounts there can be a restriction in the use of inode. Mostly the inode can be loaded by the e-mails, once the inode utilization becomes full then the server will stop working.

So for verifying inodes you can follow the steps below. First of all  make sure to enable this feature within your WHM >> Tweak Settings

(Display File Usage information in the cPanel stats bar (inode count)

inode-usage

For checking the usage of inodes on the entire server you can use the following command :

df -i

We can see the count and percentage of free inodes from the respective tabs.

To find the inode usage of a single cPanel account:

cd ~username

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"

That’s it.