0

I have an issue while running du that it does not display the usage in units of Megabytes (as expected with -m switch) but TB:

$ du -mhs /mnt/b
2.0T    /mnt/b

How can I get a more granular result?

sophros
  • 111
  • 1
  • 4

2 Answers2

4

You need to remove the 'h'. That will convert everything to the most close size format, overwriting the other parameter.

So the proper command would be du -ms /mnt/b

Overmind
  • 3,076
  • 2
  • 16
  • 25
4

Use the -m option by itself to display the disk usage in 1 Megabyte block units. Note that the disk usage will be displayed as an integer, i.e. only a number without a unit size.

The -h switch "overrides" the -m switch and will display the disk usage not in blocks of any size, but in a human readable format, converting to GB's and TB's as needed. That number will include unit sizes like k, M, G, T

HBruijn
  • 77,029
  • 24
  • 135
  • 201