du如何计算文件的大小(以千字节为单位)?

时间:2014-04-16 12:13:43

标签: du

我有一个文件 “du -b filename”给出67108864作为答案(应该是以字节为单位) 而 “du filename”给出65604(应该是以千字节为单位)。但是,应该返回67108864/1024 = 65536作为答案。 我看着du的男人入口,但找不到答案。我错过了什么? 我在64位计算机上运行Ubuntu 12.04版。

1 个答案:

答案 0 :(得分:2)

-b不只是字节:

  -b, --bytes           equivalent to `--apparent-size --block-size=1'
  --apparent-size   print apparent sizes, rather than disk usage; although
                      the apparent size is usually smaller, it may be
                      larger due to holes in (`sparse') files, internal
                      fragmentation, indirect blocks, and the like