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

/bin/sh^M: bad interpreter: No such file or directory Linux

Send mail from Oracle Solaris OS with attached files