How much disk space does a list of files use
You can use tail
to cut the last line (the total) from the output of du
:
du -c *.sql | tail -n 1
There seems to be no way to make du
itself report just the total of a set of files.
What doesn't work from your example? Do you want a sum?
man du
shows that the -c
option provides a sum of usage:
du -sc *.sql
You may also like the -h
or -k
arguments.
Your question is very ambiguous but I suspect you are looking for the -c
flag to produce a total.
du -c *.sql