If you want output in Kb
ls -l | awk '{s+=$5} END {print "Average file size: " s/NR/1024 "k"}'
Average file size: 28683.4k
ls -l | awk '{s+=$5} END {print "Average file size: " s/NR/1024 "k"}'
Average file size: 28683.4k
If you want output in MB
ls -l | awk '{s+=$5} END {print "Average file size: " s/NR/1024/1024 "MB"}'
Average file size: 28.0112MB
If you want output in GB
ls -l | awk '{s+=$5} END {print "Average file size: " s/NR/1024/1024/1024 "GB"}'
Average file size: 0.0273546GB
No comments:
Post a Comment