How to clean up the Linux hard disk space when it is full

background

When I connect to MySQL remotely, an error message shows that the tmp space is gone. I enter Linux to check

View space usage

df -h

insert image description here
Uh, I’m so tired, I only have 40G of space in total, and the usage has reached 100%, so I have to clean it up quickly

View files larger than 100 megabytes

find / -size +100M |xargs ls -lh 

insert image description here
Suddenly remembered, I used to use the server as a transfer station, uploaded a video of about 15G, and then deleted it

rm -rf /root/learn/python/*

Note: du -h --max-depth=1You can view the current folder size

clear log

You can see that the log of a project has reached more than 400 MB, let’s also clean it up

cat /dev/null > /root/java/blog/nohup.out

View the effect

Now 22G is available again, be happy

insert image description here

Guess you like

Origin blog.csdn.net/m0_46521785/article/details/122753266