You are here

Count inode usage per directory

 

 

 #!/bin/bash
  #===============================================================================
#
#          FILE: inode-list.sh
#
#         USAGE: ./inode-list.sh
#
#   DESCRIPTION:
#
#       OPTIONS: startdir start with /
#  REQUIREMENTS: ---
#          BUGS: ---
#         NOTES: ---
#        AUTHOR: Tamas Papp (tamas.papp@mikrobit.hu),
#  ORGANIZATION: mikrobit.hu
#       CREATED: 2015-05-06 11:36
#      REVISION:  ---
#===============================================================================

set -o nounset                              # Treat unset variables as an error
startdir=$1
dirlist=`ls $1`
for i in $dirlist; do
echo -e "$startdir/$i\t"
find $startdir/$i -printf "%i\n" | sort -u | wc -l
done