Delete large files under CentOS

Source: Internet
Author: User

Today the test server disk space is found to use 100%. by DF-LH and Du–sh, locate the Jenkins log file 363G. Find a few ways to delete large files on the Web:

One, the most Low: RM

After RM deletes large files, DF–LH view will find that the disk is still occupied.

This is because RM deletes the file, and the file is generally not written to disk immediately, i.e. the space is not released immediately.

The way to resolve:

1. Restart the server (preferably not selected);

2.LOSF | grep deleted; View the deleted process

650) this.width=650; "title=" image "style=" border-top:0px; border-right:0px; Background-image:none; border-bottom:0px; padding-top:0px; padding-left:0px; border-left:0px; padding-right:0px "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M00/6F/F9/ Wkiol1wvdrudufdqaaf0pkudlj0839.jpg "" 614 "height=" 188 "/>

Process is not closed, so disk space will not be freed, need kill–9 PID, kill the process, the space will be released.


Second, input redirection:

There are several ways to clear the contents of a file without deleting the file

1. Echo >/path/to/somefile

2. Cat/dev/null >/path/to/somefile

3. >/path/to/somefile

4: >/path/to/somefile

Delete large files under CentOS

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.