How to solve the disk full issue in Linux quickly?

Disk FULL?

Find disk size

df -h

find which folder/files are too big in GB or in MB, top 20

cd /
sudo du -h 2>/dev/null | grep '^\s*[0-9\.]\+G' | sort -nr | head -20

or

sudo du -h 2>/dev/null | grep '^\s*[0-9\.]\+M' | sort -nr | head -20

Then remove unneeded big files.

find files only :

find . -type f -exec du -h {} \; | grep '[0-9\.]\+M' | sort -nr | head -20

 

Clean the dustbin too!

rm -rf ~/.local/share/Trash/files

 

Advertisements