Check usage

df -hT /

Find big files

sudo find / -type f -size +30M

With size, sort by size, clean output

sudo find / -xdev -type f -size +30M -exec du -sh {} ';' | sort -rh | head -n50

With size, sort by size

sudo find / -type f -size +30M -exec du -h {} \; | sort -rh

With many details

sudo find / -xdev -type f -size +30M -exec ls -lha {} \; | sort -nk 5

With size

sudo find / -type f -size +30M -exec du -h {} \;


sudo find / -type f -size +30M

Clear big files

Create clean into ~/scripts

sudo rm -rf /var/log/*.gz # clean logs
sudo rm -rf /var/log/nginx/*.gz # clean nginx logs
docker system prune -af # clean docker
sudo journalctl --vacuum-size=30M # clean journalctl
sudo sh -c 'rm -rf /var/lib/snapd/cache/*' # clean snap

And create symlink

sudo ln -s ~/scripts/clean /usr/local/bin/clean

Create cronjob

crontab -e
0 1 * * * sh /usr/local/bin/clean


Find big docker files

docker system df

Clear docker

docker system prune -af

Restart docker

sudo service docker restart