Home  >  Article  >  Operation and Maintenance  >  How to clean up a Linux disk that is full

How to clean up a Linux disk that is full

王林
王林Original
2020-01-11 11:13:414636browse

How to clean up a Linux disk that is full

1. Check disk usage on Linux

The command is as follows:

df -h

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 /*

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 文件名

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

(1 ) If you know the file name:

lsof | grep nohup.out

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

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!

Statement:
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