ubuntu: disk is full, Search for big files and remove

sudo du -cha –max-depth=1 / | grep -E “M|G”

ls | tail -5000 | xargs sudo rm -rf

So I listed the code first, in case that’s all what you want…

Today, 10-31-2019, is my first time to encounter the situation when my ubuntu almost run out of space.. actually, there is no space for root, \ , there are some space left for other partitions.

What problem does low in disk space cost (from my experience):

  1. can not tab complete … I forgot the exact error message, but it was something like “error, not enough temporary memory”
  2. Random errors when executing some commands: for example, I cannot delete ufw rules (everything looks fine until I displayed the status), I can not disable the ufw and many others that I can not even recall…. I thought my server got hacked…

I didn’t realize the problem until I type df -h for some reason.. and found out that the space for \ is 100% used…

So, I tried find / -size +100M -ls ( https://askubuntu.com/questions/36111/whats-a-command-line-way-to-find-large-files-directories-to-remove-and-free-up ),

The purpose of this blog

In one sentence, the purpose of this blog is for me to put down whatever stuff I tested, and feel like it will be useful in the future.

I hope what I posted here will help me organize my works better, and save a little bit of time, since some information is kind of hard to search for, or it’s just because there are too much out-dated information, so I will have to failed many times before finding the one that works.