2018-09-18 du -h -d1 只查看一级目录统计的空间占用

[root@swarm-node1 sdb]# du -sh -d1
du: warning: summarizing conflicts with --max-depth=1
Try 'du --help' for more information.


[root@swarm-node1 sdb]# du -h -d1
57M     ./leo_log_test
69G     ./dsp-bidder-logs
980K    ./shell
32G     ./leo_log
16K     ./lost+found
101G    .

-d1 表示当前目录只进入下一级目录

-s 和 -d是相互矛盾的,所以用
du -h -d1

-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

另一种写法则是du -h --max-depth=1

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,504评论 0 10
  • mean to add the formatted="false" attribute?.[ 46% 47325/...
    ProZoom阅读 2,738评论 0 3
  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 10,150评论 0 23
  • 【不忘初心】20171121学习力践行day42:1.坚持古诗叫早,听了《春晓》、《问刘十九》、《江雪》。2.英文...
    Tiffanyzj阅读 132评论 0 0
  • 写Ruby有一年多了,一直是拿着就写,对着别人的代码仿,不懂的就一个个去查,只求完成任务就好,也导致了我的视野慢慢...
    chen_lei阅读 235评论 0 0