lxk11153
V2EX  ›  问与答

Command du 统计大小区别。

  •  
  •   lxk11153 · Nov 25, 2019 · 1313 views
    This topic created in 2366 days ago, the information mentioned may be changed or developed.
    • 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
    
    Supplement 1  ·  Nov 27, 2019
    > 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 replies    2019-11-27 14:20:04 +08:00
    lxk11153
        2
    lxk11153  
    OP
       Nov 27, 2019
    @noobsheldon #1 那问题 1 呢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3171 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 11:13 · PVG 19:13 · LAX 04:13 · JFK 07:13
    ♥ Do have faith in what you're doing.