#可见, --max-depth=0的作用, 相当于-s [roc@roclinux movies]$ du --max-depth=0 -h . 5.2G #当--max-depth设定为1时, 则增加显示了第一级的文件夹大小 [roc@roclinux movies]$ du --max-depth=1 -h . 2.7G ./China 2.5G ./USA 5.2G . #当--max-depth设定为2时, 则会继续增加显示...
但是计算是用 1000 为基数而不是1024-s: 显示目录总大小-d: 是 --max-depth=N 选项的简写,表示深入到第几层目录,超过指定层数目录则忽略-c: 除了显示目录大小外,额外一行显示总占用量--time: 显示每一个目录下最近修改文件的时间-t: 是 --threshold=SIZE 的简写,过滤掉小于 SIZE 大小...
du --max-depth=1 | sort -nr | awk ' BEGIN { split("KB,MB,GB,TB", Units, ","); } { u = 1; while ($1 >= 1024) { $1 = $1 / 1024; u += 1 } $1 = sprintf("%.1f %s", $1, Units[u]); print $0; } ' 显示每个子目录的总大小,按KB/MB/GB/TB分组 ...
To sort it I don't know how to reformat it into human readable values but there's the command: peterbe@trillian:~/tmp $ du --max-depth=1 | sort -n 4 ./Foredettinghelgen 4 ./newitpdesign 12 ./fried-mugshots 44 ./IssueTrackerBlogInterface 52 ./levenstein 900 ./Example-Receipts 18...
du -ah --max-depth=1 这个是我想要的结果 a表示显示目录下所有的文件和文件夹(不含子目录),h表示以人类能看懂的方式,max-depth表示目录的深度。 du命令用来查看目录或文件所占用磁盘空间的大小。常用选项组合为:du -sh 一、du的功能:`du` reports the amount of disk space used by the specified files ...
du -h --max-depth=1 | sort -hr 显示所有子目录大小 O网页链接 û收藏 1 评论 ñ1 评论 o p 同时转发到我的微博 按热度 按时间 正在加载,请稍候...353关注 17760粉丝 41865微博 微关系 他的关注(349) sunwear Alex65 极客时间 微博广告 他的粉丝(17760) hed_hed...
有些命令我们天天都在用,但是偶尔”–help”一下,都会发现一大堆没用过的参数,从这周起,每周四,我们会为大家解剖一个...linux命令和它的“Partner command”,今天从du开始: du 用来查看linux下文件或目录占用的磁盘空间 参数说明 du * 默认显示目录内所有文件夹和...--max-depth= 超过指定层数的目录后,予以...
[root@jeven ~]# du --max-depth=3 -h / |sort -rh |head -n 20 du: cannot access ‘/proc/22348/task/22348/fd/3’: No such file or directory du: cannot access ‘/proc/22348/task/22348/fdinfo/3’: No such file or directory du: cannot access ‘/proc/22348/fd/4’: No such ...
du -h --max-depth=1 du --max-depth=1 du -h --max-depth=1 指定只递归层数,只显示目录大小
du -h --time --max-depth=1 | sort -hr 按大小排序目录 1). du disk usage: 递归显示所有文件夹的使用情况; 2). -h或--human-readable 以K,M,G为单位,提高信息的可读性。 3). 实例10:输出当前目录下各个子目录所使用的空间 命令: du -h --max-depth=1 ...