Use the find command in linux to clear system garbage

Source: Internet
Author: User
Use the find command in linux to clear system spam-Linux general technology-Linux technology and application information. The following is a detailed description. A friend who often uses linux must be familiar with a search command, that is, find. We are not talking about how to use find, but about how to use the find command to clear system garbage. Haha, in linux, it is impossible to use the find command to clear system garbage. Let's see what is impossible!

When an error occurs when a program is running in the system, the system will automatically save the data left in the memory as core files. After a long time, more and more cores will be left in the system, it is annoying to scatter like dust in every corner of the system.

At this time, we can apply the find command and add the-exec parameter to clear them.

Log on to the system with the root account. Open the terminal and enter find/-name core-print-exec rm-rf {}\;

The above command indicates that the root directory starts to search for the file or directory named core, then displays it on the computer screen, and then deletes all the results.

Finally, we will remind you that the-exec parameter must end with "\;". Otherwise, the system will prompt "find missing-exec parameter", and the command will not be executed.

In fact, it is very simple. This is just an idea. in linux, find to clear the system garbage. There are actually other methods.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.