vibol hou

How to find total file size in Linux

DOS sums up the sizes of all the files it lists when using the dir command, but Linux ls does not. Here’s an awk script that will calculate that information.

1
ls -la [filenames] | awk '{ sum += $4 } END { print sum }'

An easier command (thanks Sunny):

1
du -hs * --total

No Comments Yet


There are no comments yet. You could be the first!

Leave a Comment


Paintball 6/27/2009ChicagoWeekend Project: NemesisIchiLaguna BeachAudi Driving ExperienceJulian + YoshiSan FranciscoSan Pedro