Por conveniência, aqui está a referência para o macOS:
-
-h "Leitura legível". Use sufixos unitários: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte e Petabyte.
-
-k Exibe contagem de blocos em blocos de 1024 bytes (1 Kbyte).
-
-m Exibe contagem de blocos em blocos de 1.048.576 bytes (1 Mbyte).
-
-g Exibe contagens de blocos em blocos de 1.073.741.824 bytes (1 Gbyte).
Veja como as várias opções funcionam com um arquivo 1,234,567 KB :
$ mkfile -n 1234567k file.txt
$ du file.txt
2469136 file.txt
$ du -k file.txt
1234568 file.txt
$ du -m file.txt
1206 file.txt
$ du -g file.txt
2 file.txt
$ du -h file.txt
1.2G file.txt
Também vale a pena observar que você pode configurar o comportamento implícito através da variável de ambiente BLOCKSIZE :
BLOCKSIZE If the environment variable BLOCKSIZE is set, and the -k option is not specified, the block counts will be displayed in units of that size block. If BLOCKSIZE is not set, and the -k option is not specified, the block counts will be displayed in 512-byte blocks.