1. Check disk usage on Linux
The command is as follows:
df -h
(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 /*
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!