LinuxJanitor is the Bash script your grandmother warned you about. It's an automated, multi-distro cleaning utility that goes into the dark corners of your filesystem and kicks out the dust bunnies (and the 40GB of Docker images you haven't used since 2021).
Current Version: 2.5 "Power User Edition" โก
Because manual cleanup is for people with too much free time.
I got tired of running pacman -Sc, docker system prune, and deleting ~/.cache manually every week. So I wrote a script that does it all, looks cool while doing it (spinners! progress bars!), and supports pretty much every major distro.
Supported Distros:
- ๐น Arch Linux (Manjaro, Endeavour, etc.) - I use Arch btw.
- ๐ Debian / Ubuntu / Mint / Pop!_OS
- ๐ฉ Fedora / RHEL / CentOS
- ๐ฆ openSUSE
- Gentoo (if you are compiling this README, hi).
We have 3 levels of aggressiveness, because sometimes you just want to tidy up, and sometimes you want to nuke everything from orbit.
Runs with safety scissors. Only touches temporary caches that are guaranteed to regenerate.
- Cleans: Browser caches, Thumbnails, Temp files.
- Risk Level: 0/10. Safe for your grandma's laptop.
Default. The sweet spot. Cleans what needs to be cleaned without breaking your dev environment.
- Cleans: Everything in Safe + Package Manager Cache (apt/pacman/dnf), Trash, Journal logs (keeps last 2 weeks).
- Risk Level: 2/10. Standard maintenance.
WARNING: This mode wakes up and chooses chaos. Ideally for Power Users who know what git clone means.
- Dev Junk: Nukes
node_modulescaches, Cargo registry (Rust), Go mod cache, Gradle/Maven. (You will have to re-download deps!) - Docker: Prunes images AND Volumes (optional confirmation).
- Kernel Assassin: Hunts down old kernels and removes them (Debian/Fedora).
- Electron Bloat: Cleans heavy caches from Discord, Slack, Spotify, VS Code workspace history.
- Risk Level: 8/10. Don't come crying if you have to re-download the internet.
Download, install to ~/.local/bin, and make it executable automatically:
curl -fsSL https://raw.githubusercontent.com/ind4skylivey/LinuxJanitor/main/install.sh | bashThen you can just run it from anywhere:
system-cleanup-enhanced.sh(Running it without arguments opens the Interactive Menu)
Old school? I respect that.
# 1. Download the script (or clone this repo)
git clone https://github.com/ind4skylivey/LinuxJanitor.git
cd LinuxJanitor
# 2. Give it power
chmod +x system-cleanup-enhanced.sh
# 3. RUN IT (Opens Menu)
./system-cleanup-enhanced.shSkip the menu and just get things done:
| Flag | What it does |
|---|---|
--safe |
The boring mode. See above. |
--standard |
The default. Standard cleanup. |
--aggressive |
The fun mode. See above. |
-i |
Interactive Steps. Asks for permission before every single step. |
-y |
Yes Mode. Automatic mode. Great for cron jobs. |
-d |
Dry Run. Pretend to clean. See how much space you would save. |
The script creates a config file at ~/.config/system-cleanup/config.conf.
You can edit it manually if you want to permanently enable the "Kernel Assassin" or disable "Browser Cleanup" because you like keeping 4GB of cookies.
I am not responsible if this script deletes your homework, your Bitcoin wallet, or your cat.
I have tested this on my machines, but rm -rf is a powerful spell. Use --dry-run first if you are nervous.
Made with ๐ป and โ by iL1v3y
