How can I find how much disk does a list of files uses? I'm looking for a variation of
du -s *.sql
I want to see only the grand total, and with the command above, it always shows a line for each file.
You can use
tail to cut the last line (the total) from the output of
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
Your question is very ambiguous but I suspect you are looking for the
-c flag to produce a total.
du -c *.sql
can be a variation like:
du -sch * | tail -n 1
cat *.sql | wc -c
Answer is in bytes.