Average file size within a directory. http://vivekjain10.blogspot.com/2008/02/average-file-size-within-directory.html
# To calculate the average file size within a directory: | |
ls -l | gawk '{sum += $5; n++;} END {print sum/n;}' | |
# If you'd like to know the average size of some particular kind of file: | |
ls -l *.jpg | gawk '{sum += $5; n++;} END {print sum/n;}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment