Linux uses commands to clean large files. Steps

  

Linux files are very difficult to clean up. There are many files of large and small size. It is the quickest way to use batch cleaning. However, if there are too many files, you can clean large files first. I will introduce you to the Linux use of commands to clean up large files, freeing up system space.

Find large files

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

If you want to clear the text files and the like, can be Use

echo “” 》 /www/xxx.log

If you want to delete files larger than 50M directly, use the command

find /var/mail/-size +50M -exec rm {} ;

If you want to sort folders and files, you can use

du -s * |  Sort -nr |  Head

Linux uses commands to clean large files. This is the case. The size range of large files can be set by users. This article takes the cleaning of files larger than 50M as an example.

Copyright © Windows knowledge All Rights Reserved