How to find out how many inodes you are using on a hard disk or in a directory?
Most hosting plans have a limitation on inodes - so you need to know how many and where they are being used if you need to do some slashing.
To find the inode limit for your whole disk or VPS
df -i
Output will be similar to this:
Filesystem Inodes IUsed IFree IUse% Mounted on /dev/vzfs 1000000 805718 194282 81% /
To find and display a well formatted summary of how many inodes are in a certain directory and list all the subdirectories - move into the directory and run:
echo "Detailed 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"
Output will be similar to below
