1. 根目录下执行命令,查看每个目录下文件大小总和
root@vm10-88-88-3 /]# du -h --max-depth=1
79M ./tmp
123M ./etc
4.0K ./media
4.0K ./srv
104M ./boot
5.3G ./var
0 ./sys
8.6M ./dev
196G ./usr
4.0K ./mnt
285M ./opt
87G ./root
836K ./run
7.8G ./home
2.查询到root目录下有87G文件,搜索大于200M的文件
[root@vm10-88-88-3 /]# find /root -size +200M -exec du -h {} \;
476M /root/logs/ant/business.log.20240314
290M /root/logs/ant/business.log.20240203
229M /root/logs/ant/business.log.20240221
380M /root/logs/ant/business.log.20240317
382M /root/logs/ant/business.log.20240323
271M /root/logs/ant/business.log.20240213
312M /root/logs/ant/business.log.20240302
379M /root/logs/ant/business.log.20240311
312M /root/logs/ant/business.log.20240229
493M /root/logs/ant/business.log.20240305
319M /root/logs/ant/business.log.20240301
270M /root/logs/ant/business.log.20240216
404M /root/logs/ant/business.log.20240319
3.到对应目录下删除文件