Unix find average file size
问题 I have a directory with a ton of files I want to find the average file size of these files so something like ls somethinghere whats the average file size of everything meets that? 回答1: I found something here: http://vivekjain10.blogspot.com/2008/02/average-file-size-within-directory.html To calculate the average file size within a directory on a Linux system, following command can be used: ls -l | gawk '{sum += $5; n++;} END {print sum/n;}' 回答2: A short, general and recursion-friendly