Server Fault is a question and answer site for system and network administrators. 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

This works:

du -cshm .

But this fails:

du -cshg .

How can I see it in unit of GB?

share|improve this question
up vote 15 down vote accepted

GNU du has the --block-size option:

du -csh --block-size=1G .

As sajb noted, omitting the block size argument will automatically scale the output (and display the unit). Using any block size argument displays the number but omits the unit.

share|improve this answer

Use du -B1073741824 but beware, it gives the result in integer-units only, and won't be meaningful with -h

share|improve this answer

In addition to the previous answers, it also seems to differ between different coreutils versions (or locale?), since on my host I get:

$ du -csh .
32G     .
32G     total
$ du --version | head -1
du (GNU coreutils) 7.4
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.