centos查找大文件
查看文件系统容量
[root@localhost ~]# df -h
文件系统 容量 已用 可用 已用% 挂载点
devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs 1.9G 4.0K 1.9G 1% /dev/shm
tmpfs 1.9G 199M 1.7G 11% /run
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/mapper/centos-root 36G 19G 17G 52% /
/dev/sda1 1014M 193M 822M 19% /boot
tmpfs 379M 0 379M 0% /run/user/0
查找大文件夹
[root@localhost ~]# cd /
[root@localhost /]# du -h -x --max-depth=1
36M ./etc
843M ./root
12G ./var
4.0K ./tmp
5.7G ./usr
0 ./home
0 ./media
0 ./mnt
312M ./opt
32K ./srv
18G .
反复cd 大文件夹 并执行
du -h -x --max-depth=1
排序并查找最大的十个文件夹
du -hm --max-depth=2 | sort -nr | head -10
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!