Unix – How to get number of inodes for the current folder

If you need to get a list of all files and folder for the current directory with a number of inodes what are used.

All that you need is to open terminal -> navigate to the folder of interest an insert this command.

find . -printf "%h\n" | cut -d/ -f-2 | sort | uniq -c | sort -rn

The output will be sorted list of a folder with used inodes. Example:

 390020 ./new.emotors.cz
 346168 ./emotors.cz
  75717 ./empresta16
   2976 ./isdt.emotors.cz
     99 ./emotors_merge_script
     55 .
     15 ./shopchecker
      1 ./synology.steinovi.cz

Leave a Comment

Your email address will not be published. Required fields are marked *