Neil Developer

linux 清理磁盘,查找大文件

2014-09-20
Neil

查看磁盘的占用:

df  -h
neil@dedia:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2       139G   37G   96G  28% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
udev            983M  4.0K  983M   1% /dev
tmpfs           199M  500K  198M   1% /run
none            5.0M     0  5.0M   0% /run/lock
none            992M     0  992M   0% /run/shm
none            100M     0  100M   0% /run/user
/dev/sda1       180M   34M  134M  20% /boot

如果需要清理磁盘的话, 用 find 命令找出大文件,然后酌情删除:

find / -size +100M -exec ls -lh {} \;

这就是要查找磁盘上大于100m 的文件.

参考:

http://lovesoo.org/linux-system-to-find-clean-the-disk-file.html


Comments

Content