Linux 查看当前目录及子目录文件及文件夹占用存储大小

max-depth 子目录级别

  • 查看1级子目录
> sudo du -h -x --max-depth=1
38M     ./etc
25M     ./root
11M     ./tmp
16G     ./var
3.9G    ./usr
8.6G    ./home
0       ./media
0       ./mnt
53G     ./opt
0       ./srv
21G     ./temp
100G    .
  • 查看2级子目录
> sudo du -h -x --max-depth=2
395M    ./hadoop-bin/data
395M    ./hadoop-bin
2.8M    ./mysql/mysql
4.0K    ./mysql/performance_schema
104K    ./mysql/test
227M    ./mysql/swupl@002dsdc
1.7M    ./mysql/new@002drad
415M    ./mysql
12K     ./redis
31M     ./website/sdc-swupl
31M     ./website
21G     ./backup/clouddoc
0       ./backup/logs
21G     ./backup
21G     .

你可能感兴趣的:(Linux 查看当前目录及子目录文件及文件夹占用存储大小)