Skip to main content

maclean

A script to automate some relatively safe cleaning activities for Linux users.

Just run the script and answer the prompts.

Example Run

$ maclean -h
 maclean

A script to automate some relatively safe cleaning activities.

Usage: maclean [option]

Extra Options:
-h Print this Help
-j Clean only the junk directories
-d Clean only the developer directories
-c Clean only the container directories
-b Clean only the few basic directories
-a Automatically affirm all Cleanings

Operations Table

OperationCleanRemovePathsNotes
User-defined Junk~/.adobe , ~/.macromediaDefault targets listed. Edit or add to the array in the script.
Thumbnail cache~/.cache/thumbnailsKeep anything accessed within last 2 weeks.
$HOME cache~/.cacheKeep select directories*. Keep anything accessed within last 2 weeks.
Journal logsKeep logs from the last 2 weeks.
Coredumps/var/lib/systemd/coredumpRemoval.
SNAP data~/.snap , ~/snap , /var/lib/snapdCleaning if installed. Removal if uninstalled.
Flatpak data~/.var/app , ~/.local/share/flatpak , /var/lib/flatpak , /var/tmp/flatpak-cache*Cleaning if installed. Removal if uninstalled.
Go data~/go , ~/.cache/go-buildCleaning if installed. Removal if uninstalled.
Java cache~/.java/deployment/cache , ~/.config/java/deployment/cacheRemoval.
npm cache~/.npmCleaning if installed. Removal if uninstalled.
yarn cache~/.yarnCleaning if installed. Removal if uninstalled.
rust crates~/.cargoCleaning if installed. Removal if uninstalled.
ruby gems~/.local/share/gemCleaning if installed. Removal if uninstalled.
pip cache~/.cache/pipCleaning if installed. Removal if uninstalled.
pkgfile cache/var/cache/pkgfileRemoval if uninstalled.
PackageKit cache/var/cache/PackageKit , /var/lib/PackageKitCleaning if installed. Removal if uninstalled.
Pamac data/var/tmp/pamac , /var/tmp/pamac-build-"$USER"Removal if uninstalled.
AUR Helper cacheLoop through supported AUR Helpers to invoke their cleaning flags.
Package cache/var/cache/pacman/pkgRemove all uninstalled cache, unused repos, and/or all but 2 latest installed cache.
Orphan Packages/var/cache/pacman/pkgRemove all orphan packages. Please review before confirmation.
pacnew+pacsave filesⁿ/ₐⁿ/ₐWarning Only. Use pacdiff to manage.

Download and more information at the Gitlab Page