How to clean centos garbage?
First check the disk space usage, use the df command:
df –TH “dev/mapper/vg_co65-lv_root”这个分区已经使用了93%了。
Cleaning method:
1, cd /usr;
2. du -sh *
(See which directory takes up more space);
3. Repeat the first two steps and delete or move it according to the actual situation;
4. Can you run the log?cat /dev/null > file.log"
Clear;
5. Find large files (more than 100M)"find / - size 100M -exec ls -lh {} ;"
, move or uninstall according to the situation, the software package can be uninstalled with "rpm -e", and the file can be deleted with "rm -rf dir"
;
6. You can also use "du -h --max-depth=1
/path" to query the folder occupation and display the total space occupied by the directory, for example: " du -h --max-depth=1 /var”
, when deleting files, be careful not to delete system files.
Related references: centOS tutorial
The above is the detailed content of How to clean centos garbage. For more information, please follow other related articles on the PHP Chinese website!