shell script count files per directory


 Using this single line scrpit, you can easily find the number of files inside each subdirectories.


find . -type d -print0 | while read -d '' -r dir; do files=("$dir"/*); printf "%5d files in directory %s\n" "${#files[@]}" "$dir"; done

Comments

Popular posts from this blog

CDbConnection failed to open the DB connection mysql 8

How to replace find -maxdepth option in Solaris Operating System using -prone

IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified [ISQL]ERROR: Could not SQLConnect