Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

This command:

$ time (\ls /path/to/lots/of/dir*/*/*/*.ext > inputs.txt )

real    1m9.064s
user    1m3.265s
sys     0m5.993s

Gives me a huge list of file names inside the file "inputs.txt".

I need to know the total size of all files described in inputs.txt, preferably without list all of them.

share|improve this question

1 Answer 1

You need to use the option -c of du:

du -csh /path/to/lots/of/dir*/*/*/*.ext

To show only the final count, you can use tail -n 1:

du -csh /path/to/lots/of/dir*/*/*/*.ext | tail -n 1
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.