CommandLineFu: File/Byte Count of Folder List

 while read -r dir; do echo -n `du -hsb "$dir"` ; echo "|"`find "$dir" -type f | wc -l` ; done < UD_input.txt | tee UserData.log

 

Uses text file with one directory per line as input and prints:

BYTES [space] DIRECTORY NAME [pipe] FILE COUNT

1842531456 ./FD99_UserShare/z/Bond/|213

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s