ducommand on many BSD-derived systems reports the number of 1,024-byte blocks. Solaris reports the number of 512-byte blocks. On Linux, the units reported depend on the whether the
POSIXLY_CORRECTenvironment is set. When it is set, the
ducommand reports 1,024-byte block units; when it is not set, the command reports 512-byte block units.
First I run:
ls -ls APUE.pdf
du -s APUE.pdf
18680 -rw-r--r-- 1 tianhe tianhe 19126025 2月 25 17:09 APUE.pdf
19126025 / 18680 = 1023.877141328. So it's reporting as 1024-byte blocks.
Then I type:
POSIXLY_CORRECT=1 in the current shell and run the above command again but still get the same.
What's wrong here?