How to clean up a Linux disk that is full

王林
Release: 2020-01-11 11:13:41
Original
4601 people have browsed it

How to clean up a Linux disk that is full

1. Check disk usage on Linux

The command is as follows:

df -h
Copy after login

How to clean up a Linux disk that is full

(Free video tutorial sharing:linux video tutorial)

2. Check the disk usage of the current folder on Linux

The command is as follows:

du -sh /*
Copy after login

How to clean up a Linux disk that is full

3. Delete the file that takes up the largest space, such as the log file. The

command is as follows:

rm -rf 文件名
Copy after login

4. The deleted file may still be used by a process

(1 ) If you know the file name:

lsof | grep nohup.out
Copy after login

Find out what process is using this file, and then kill it to free up space.

(2) If you don’t know the file name:

lsof | grep deleted
Copy after login

This will find all deleted files but the file handle has not been released. Just kill them after they are found.

Recommended related articles and tutorials:linux tutorial

The above is the detailed content of How to clean up a Linux disk that is full. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!