tyrel.cloud


All posts tagged:


Linux Disk Space Cleanup

Updated by Tyrel on 2020-10-08

Summary

I don't need to do it often, but when I do this is where I start

Linux Disk Space Cleanup

This is super helpful when your running low on space and you need to quickly find the offenders.


Finding Offending Directories and Files

Top 20 Files Directories

cd / && sudo du -ahx . | sort -rh | head -20

    6.1G    .
    3.7G    ./usr
    2.2G    ./usr/src
    1.2G    ./home/ubuntu
    1.2G    ./home
    924M    ./usr/lib
    861M    ./home/ubuntu/trading
    740M    ./var
    540M    ./var/lib
    379M    ./home/ubuntu/trading/oanda_fx
    373M    ./home/ubuntu/trading/oanda_fx/logs
    308M    ./lib
    302M    ./var/lib/snapd
    270M    ./usr/lib/x86_64-linux-gnu
    259M    ./usr/share
    259M    ./lib/modules
    240M    ./usr/lib/chromium-browser
    218M    ./home/ubuntu/.local/lib/python3.6/site-packages
    218M    ./home/ubuntu/.local/lib/python3.6
    218M    ./home/ubuntu/.local/lib

SystemD Journal Cleanup

sudo journalctl --vacuum-size=50M

Feel like I missed something? Let me know in the comments!