du -hc shows the size of the files as multiples of the block size of the filesystem, which is typically 4K. This is actual disk usage of the listed files. The
-h option prints sizes using a human-readable format (K/M/G) and the
-c option prints the grand total size at the end of the list.
[root@testvm1 etc]# du -hc *.conf
du -bch, the
-b parameter lists the file sizes in bytes. However, this option also implies the
--apparent-size option, which shows the apparent sizes of files as opposed to their disk usage. This usually results in a lower total:
[root@testvm1 etc]# du -bch *.conf
du -sh uses the
-s option, which displays the total size for each argument. This option is typically used with directories. When used against a list of files, the
-s option does not produce any special output. The output of your
du -bsh command will most likely be the size of the last file in list.
-b option is equivalent to
--apparent-size --block-size=1. To use block-size calculations while keeping the unit as bytes, use only the
[root@testvm1 etc]# du --block-size=1 -c *.conf