Distributions
› Ubuntu
› Fedora
› CentOS
中文资源站
› 网易开源镜像站
fzinfz
V2EX  ›  Linux

du -hs / du -h --max-depth=1 / ncdu 显示的文件夹大小不同?

  •  
  •   fzinfz ·
    fzinfz · Aug 10, 2016 · 3966 views
    This topic created in 3741 days ago, the information mentioned may be changed or developed.

    同一个 du 运行的结果竟然不同? du -hs / du -h --max-depth=1 有啥区别?

    ncdu 子文件夹的大小总和竟然大于 total ?

    如何复现:

    1. 安装 anaconda
    2. conda create --name py35 --clone root
    3 replies  •  2016-08-10 19:03:05 +08:00
    metrue
    metrue
    Aug 10, 2016 via Android
    1
    有一种东西叫 man
    fzinfz
    fzinfz
    OP
    Aug 10, 2016
    2
    @metrue

    ncdu 貌似是因为 hard links 的 bug :

    BUGS
    Directory hard links are not supported. They will not be detected as being hard links, and will thus be scanned and counted multiple times.

    du 是为什么么?-d/-s 会影响大小计算?

    -d, --max-depth=N
    print the total for a directory (or file, with --all) only if it is N or fewer levels below the command
    line argument; --max-depth=0 is the same as --summarize

    -s, --summarize
    display only a total for each argument
    fzinfz
    fzinfz
    OP
    Aug 10, 2016
    3
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1824 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 09:42 · PVG 17:42 · LAX 01:42 · JFK 04:42
    ♥ Do have faith in what you're doing.