命令是:du -h --max-depth=1
,这个命令中:
- -h:更好看容量大小
- max-depth:显示的目录深度,=1即表示将容量都加和到指定的目录的文件夹下
比如:
cd ~
du -h --max-depth=1
显示:
8.0K ./.vim
4.0K ./.landscape
8.0K ./tmp_file
8.0K ./.conda
4.0K ./.pip
201M ./.cache
3.6G ./anaconda3
其中./anaconda3
占用了3.6G,再次使用:
cd anaconda3/
du -h --max-depth=1
得到结果:
31M ./translations
8.0K ./condabin
74M ./include
56K ./man
3.2M ./mkspecs
568K ./doc
664K ./libexec
96K ./etc
12K ./x86_64-conda_cos6-linux-gnu
15M ./plugins
2.3G ./lib
8.0K ./compiler_compat
13M ./qml
55M ./share
185M ./envs
276K ./ssl
788K ./sbin
184M ./bin
18M ./resources
24K ./shell
831M ./pkgs
12K ./var
4.0K ./phrasebooks
6.2M ./conda-meta
3.6G .
即可得到每个anaconda3
的文件夹下每个目录所占的容量