how to find the no of inodes used on a specific folder

how to find the no of inodes used on a specific folder

it is very easy to count the no of inodes used folder wise using the below command.

root@earn # 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"

This command in plan text below just copy and paste in on the specific folder

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"

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”

You will get the result as below.

root@earn # 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"Detailed Inode usage for: /home/icsbhdio11              - .cagefs2               - .cl.selector73              - .cpanel1               - etc1               - .htpasswds3               - logs16              - mail2               - public_ftp58              - public_html4               - .softaculous6               - ssl37              - tmp1               - .trashTotal:          224

Comments

This site uses Akismet to reduce spam. Learn how your comment data is processed.