Total size of multiple directories

Michael Torrie torriem at gmail.com
Fri Jun 25 14:29:35 MDT 2010


On 06/25/2010 02:19 PM, Andrew Hunter wrote:
> du --max-depth=1 dir1 dir2 dir6 dir8 dir11 dir15 dir21 | awk '{sum =
> sum + $1 ; print} END {print sum}'
> 
> 2940972 dir1
> 1043935 dir2
> 1365310 dir6
> 317     dir8
> 610     dir11
> 5448534 dir15
> 1558372 dir21
> 12358050

Or you could use:

du -c dir1 dir2 dir6 dir8 dir11 dir15 dir21

2940972 dir1
1043935 dir2
1365310 dir6
317     dir8
610     dir11
5448534 dir15
1558372 dir21
12358050 total


More information about the PLUG mailing list