V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
lxk11153
V2EX  ›  问与答

Command du 统计大小区别。

  •  
  •   lxk11153 · 2019-11-25 18:38:14 +08:00 · 862 次点击
    这是一个创建于 1604 天前的主题,其中的信息可能已经有所发展或是发生改变。
    • Android (app: termux)
    > fd -HI . image2|wc -l
    217773
    > du -ks image2
    3818440 # kilobytes
    
    • scp 到优盘,文件系统格式是 hfs,电脑系统格式是 MacOS
    > fd -HI . image2|wc -l
      217773
    > gdu -ks image2
    3587536	image2 # kilobytes
    > gdu -ks --apparent-size image2
    3382593	image2 # kilobytes
    
    • 文件数都是 217773 (fd: https://github.com/sharkdp/fd)
    • gdu 是 GNU coreutils 套件的 du
    • 问题 1: 一个 3818440 一个 3587536,是因为 du 程序还是文件系统格式不同导致结果不同?如何输出一致?
    • 问题 2: 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
    
    第 1 条附言  ·  2019-11-27 14:19:47 +08:00
    > fd -HI . image2|wc -l
      217773
    > du -ks image2 # BSD
    3587536	image2 # kilobytes
    > gdu -ks image2 # GNU
    3587536	image2 # kilobytes
    > gdu -ks --apparent-size image2
    3382593	image2 # kilobytes
    
    2 条回复    2019-11-27 14:20:04 +08:00
    lxk11153
        2
    lxk11153  
    OP
       2019-11-27 14:20:04 +08:00
    @noobsheldon #1 那问题 1 呢
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1209 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 18:14 · PVG 02:14 · LAX 11:14 · JFK 14:14
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.