Linux 查看当前目录下各个文件夹包括隐藏文件夹的大小,并从大到小排序返回结果

$ du -h --max-depth=1 | sort -hr
49G	.
27G	./Nutstore Files
11G	./anaconda3
5.0G	./src
2.4G	./.cache
1.2G	./.nutstore
1.2G	./.local
1019M	./.config
320M	./.vscode
141M	./.mozilla
94M	./project
74M	./snap
44M	./.lantern
30M	./.kite
14M	./.vim
2.6M	./pegaflow
2.4M	./.thunderbird
1.1M	./.swt
756K	./.ipython
472K	./Pictures
400K	./Desktop
232K	./.sogouinput
128K	./.pylint.d
104K	./Templates

不包含隐藏文件夹

du -sh * | sort -hr
27G	Nutstore Files
11G	anaconda3
5.0G	src
94M	project
74M	snap
2.6M	pegaflow
472K	Pictures
400K	Desktop
104K	Templates
32K	Downloads
24K	copytranslator
8.0K	Documents
4.0K	Videos
4.0K	Sunlogin Files
4.0K	sensors
4.0K	Public
4.0K	Music
0	orayconfig.conf

查看当前目录总大小

du -sh
49G	.

猜你喜欢

转载自blog.csdn.net/zdx1996/article/details/114253121