Sometimes, a service suddenly hangs and starts again but fails to start. A look, the original disk space is full, so, how to clean it. The introduction is as follows:
Df-h, this command is used to view the server space. The rendering after running is as follows:
As you can see, I have 8 grams left.
Du-h — Max-depth =1, this command is used to see the current directory, which file occupies the most space, the operation effect is as follows:
As you can see, the IOV directory takes up a lot of space, 20G.
In addition, du-sh *, this command is also used to see the size of each file and folder under the current directory. The operation effect is as follows:
As you can see, the IOV directory takes up a lot of space, 12G.
Enter ioV directory, repeatedly execute the above view command, follow up all the way, find each directory takes up more space of the file, useless can be deleted.
As you can see, this nohup.out log file takes up a lot of space (1.9g). Now leave it empty.
The command can be used: cp /dev/null nohup.out. After clearing, check again, the occupancy is reduced (696K) as expected.
Df-h, this command is used to view the server space. The rendering after running is as follows:
As you can see, I have 8 grams left.
Du-h — Max-depth =1, this command is used to see the current directory, which file occupies the most space, the operation effect is as follows:
As you can see, the IOV directory takes up a lot of space, 20G.
In addition, du-sh *, this command is also used to see the size of each file and folder under the current directory. The operation effect is as follows:
As you can see, the IOV directory takes up a lot of space, 12G.
Enter ioV directory, repeatedly execute the above view command, follow up all the way, find each directory takes up more space of the file, useless can be deleted.
As you can see, this nohup.out log file takes up a lot of space (1.9g). Now leave it empty.
The command can be used: cp /dev/null nohup.out. After clearing, check again, the occupancy is reduced (696K) as expected.
So, how do you clean up if the nohup.out file isn’t taking up space?
Very simple, just use the normal delete command.
Delete command: RM [options] file or directory
Option description:
-F-force ignores files that do not exist and forces deletion without prompting
-i– Interactive for interactive deletion
-r |-r –recursive deletes all directories and files under a listed directory
-v — Verbose verbose displays details of the steps performed
Command instance:
1. Delete the a.T.Xt file
Rm – rf a.t xt
2. Delete the Mplogs directory
rm -rf mplogs
Here we use example 2 to delete, and the effect is as follows:
Now that I’ve cleaned up a little bit, I go back to the root directory, and I’ve reduced the footprint.
Read More:
- U disk installation Linux system could not boot, / dev / root does not exist and the identified hard disk space is not available
- Linux view folder size, remaining disk space (DU / DF)
- The most complete collection of solutions to Tortoise SVN Clean up failure
- Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:3.0.0:clean (default-clean) on
- Failed to execute goal org.apache.maven.p1ugins:maven-clean-p1ugin:2.5:clean (default-clean)
- Error 945 Database cannot be opened due to inaccessible files or insufficient memory or disk space
- Insert datagram error: ISAM error: no free disk space
- Insufficient space in the root directory causes the state of the managed server to become FAILED_NOT_RESTARTABLE
- Viewing the file system format of disk partition under Linux
- Non system disk or disk error
- Disk read error solution for new hard disk installation
- The MySQL service suddenly hangs up with the error message can’t connect to MySQL server on ‘localhost’ (10061)
- Solve the problem of non system disk or disk error, replace and strike any key when ready
- Google cloud disk: too many users have recently viewed or downloaded this file. Please try to access this file later. (How to Bypass Google Drive Download Limit (Quota Exceeded) Error)
- The Linux version of todesk cannot connect to the server
- The computer can’t turn on ERROR: NO BOOT DISK HAS BEEN DETECTED OR THE DISK HAS FAILED
- Failed to load vmmr0.r0 (Verr_ SUPLIB_ PATH_ NOT_ CLEAN).
- On the use of NPM cache clean — force
- Linux error deletion libc.so.6 how to recover
- PHP under linux uses pdo-dblib to connect to mssql to report an error solution. Error message: SQLSTATE[01002] Adaptive Server connection failed (severity 9)