1848816 Members
7826 Online
104037 Solutions
New Discussion

du

 
carl_46
Advisor

du

I am trying to find out the total size of serveral files in a directory.

du -sk att*

this gives me each files size instead of its total, any ideas?
3 REPLIES 3
Anthony deRito
Respected Contributor

Re: du

du -s will show you the grand total of all files in the current directory. The number on the left is the number of 512 byte blocks. Multiply this number by 512 and the result will give you total size in bytes. Leave off the -u argument and you will see a breakdown of directory size contents.

Use the -x option if you do not want to go beyond filesystem boudaries.

Tony
Rick Garland
Honored Contributor

Re: du

Use different options fo the du command.
There is an option to give individual file size as well as the size of the directories.
curt larson
Frequent Advisor

Re: du

du -sk att* | awk '{total = total + $1;} END {print total;}'
nobody else has this problem