How to clean up the disk space of Linux server

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.

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: