How much disk space does a list of files use

command linedisk-usage

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.

Best Answer

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.

Related Question