Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Linux, I know I can use

find ./ -size +1M

to find files which are bigger than 1M, but how do I sum the total space needed by these files?

share|improve this question
up vote 2 down vote accepted

You can -execute a program on each of the find results.

-exec utility [argument ...] {} +

Same as -exec, except that ``{}'' is replaced with as many pathnames as possible for each invocation of utility. This behaviour is similar to that of xargs(1).

Run du -c to sum of disk usage (number of used blocks) on the results, like this:

find ./ -size +1M -exec du -c {} +

Optionally add -h to get human readable sizes, or -k for 1k blocks. Add -s if a different find expression also returns folders.

This requires that there aren't too many results, since it builds a single du call from the file names, and if that gets too long, it'll split it up into separate calls with separate totals.

share|improve this answer

Your Answer


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.