Today a friend of the server space is full, check found that the server Apache logs occupy 3.6G of space, the log clean up after found df-h still show/Occupy space for 100%
What is this for? Because some of the programs that are programmed to run Linux do not immediately make room for deletion, and he deletes exactly the Apache log file that is running in
Use the following command to see which files are still occupied by which process
The code is as follows |
Copy Code |
ls-ld/proc/*/fd/* 2>&1 | Fgrep ' (deleted) ' Lsof/
|
Of course, we can release the space that is occupied by the log by simply restarting Apache in the case above, which is more clear who is occupying it.
About the DF command in Linux
Description: The DF command in Linux shows the use of the I node and disk block by all file systems.
The various options for this command have the following meanings:
-a displays disk usage for all file systems, including 0 block file systems, such as the/proc file system.
-K is displayed in K-byte units.
-I displays the I-node information, not the disk block.
-T displays disk space usage for each file system of the specified type.
-x Lists disk space usage (contrary to the T option) that is not a file system of a specified type.
-T displays the file system type.