Last Updated: February 25, 2016
·
543
· danjesus

See the average size of files in linux

Install gawk - Debian Like ->
apt-get install gawk

find /some/dir -type f \
-print0 | xargs -0 ls -l | gawk \
'{sum += $5; n++;} END {print "Total Size: " sum/1024/1024 " MB : Avg Size: " sum/n/1024 " KB : Total Files: " n ;}'