Quantcast
Channel: Web Host
Viewing all articles
Browse latest Browse all 31

iNode What You Did Last Summer

$
0
0

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
inode-usage-directory
 
 

 

Tags:


Viewing all articles
Browse latest Browse all 31

Trending Articles