How To Calculate Inode Usage From Shell Prompt?

Have you ever reached to allowed Inode Usage of your hosting account? Today, we will learn about the simple command which you can use/fire on shell prompt. You can get detailed info about the usage of inode/files of your hosting account.


What exactly is Inode?

Inodes are an information structure that is used to record details about a file in the hosting server. Inode usage/count is the number of folders and files that you own. This includes everything in your account, including emails as well as folders, files, and everything you save within the system.

Command to check complete Inode Usage from shell prompt:

Most hosting providers are offering SSH/terminal access for the hosting accounts. Users can fire the below command from their home directory or the exact directory where they wish to get the inode usage.

clear;echo “Detailed Inode usage: $(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”

Here is the example output of the above command:

Detailed Inode usage: /home/nocserve
1 – cache
136 – .cagefs
3 – .cl.selector
39 – .cpanel
7 – .cphorde
17 – etc
1 – .htpasswds
15 – logs
435 – mail
2 – .pki
3 – public_ftp
20166 – public_html
8 – .razor
2 – .sitepad
9 – .softaculous
2 – .spamassassin
51 – ssl
2 – .subaccounts
587 – tmp
266 – .trash
Total: 21762


Such the best output will help you to understand the exact usage, and you can take action accordingly. Signup with Hostpoco to get high Inode limit and SSH access.