From the man page for du
:
-b, --bytes
equivalent to '--apparent-size --block-size=1'
-h, --human-readable
print sizes in human readable format (e.g., 1K 234M 2G)
The -h
switch will display the output using units, blocks have no units, so these 2 switches aren't suppose to be used together!
NOTE: The command du
will therefore display its output based on which ever switch occurs last in the command line arguments.
Examples
b switch examples
$ du -hb XnConvert.x86_64.rpm
13950768 XnConvert.x86_64.rpm
$ du -b XnConvert.x86_64.rpm
13950768 XnConvert.x86_64.rpm
$ du -h -b XnConvert.x86_64.rpm
13950768 XnConvert.x86_64.rpm
h switch examples
$ du -bh XnConvert.x86_64.rpm
14M XnConvert.x86_64.rpm
$ du -h XnConvert.x86_64.rpm
14M XnConvert.x86_64.rpm
$ du -b -h XnConvert.x86_64.rpm
14M XnConvert.x86_64.rpm