linux服务器设备上没有空间

df -h

查看到磁盘使用了100%

如何找到占用磁盘最大的目录

cd /
du -h --max-depth=1

查看占用内存大小,最大的是lib目录

cd lib
du -h --max-depth=1

一层一层往下看

数据库mysql占用最大文件有14G

断定这个目录没用,果断删除
rm -rf


附录

以兆为单位查看文件大小,两种方法
ls -lh
ls -l --block-size=M

以G为单位查看文件大小
ls -l --block-size=G

原创文章,欢迎转载,转载请注明出处!

猜你喜欢

转载自www.cnblogs.com/acm-bingzi/p/linux_df.html