我知道我可以使用du -h输出目录的总大小。但是,当它包含其他子目录时,输出将类似于:
du -h /root/test
.
.
.
.
24K /root/test/1
64K /root/test/2
876K /root/test/3
1.1M /root/test/4
15M /root/test/5
17M /root/test
我只想要最后一行,因为目录中有太多小/root/test
目录。我能做些什么?
添加--max-depth
值为0的参数:
du -h --max-depth=0 /root/test
或者,使用-s
(摘要)选项:
du -sh /root/test
这些都应该给你你想要的。供以后参考,man du
非常有帮助。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句