Admin-Ahead Community

Linux => General Linux => Topic started by: vinayakk on March 18, 2014, 06:48:01 am

Title: How many inodes you have in a directory?
Post by: vinayakk on March 18, 2014, 06:48:01 am
Here’s a great one-liner for finding out how many inodes you have in a directory:

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"

 :)  ;)