clean.sh is a safe disk cleanup utility with a Dialog TUI and optional CLI mode.
- Find large files by threshold (default:
500MB) - Preview temp files older than N days (default:
7) - Preview cache files under a target cache directory (default:
~/.cache) - Confirm before delete in TUI
- Dry-run behavior in CLI unless
--applyis passed - Logs written to
./logs/
- Bash 4+
find,xargs,awk,sort,wcdialog(required for TUI only)
Install dialog:
- Debian/Ubuntu:
sudo apt-get install dialog - RHEL/CentOS:
sudo yum install dialog - macOS (Homebrew):
brew install dialog
Make it executable:
chmod +x clean.shLaunch Dialog TUI:
./clean.shYou can run actions directly without TUI.
Preview only:
./clean.sh --find-large
./clean.sh --clean-temp
./clean.sh --clear-cache
./clean.sh --allApply cleanup (for temp/cache actions):
./clean.sh --clean-temp --apply
./clean.sh --clear-cache --apply
./clean.sh --all --applyCustom options:
./clean.sh --find-large --scan-dir "$HOME" --threshold 1024
./clean.sh --clean-temp --temp-days 14
./clean.sh --clear-cache --cache-dir "$HOME/.cache"Help:
./clean.sh --help- TUI always previews and asks for confirmation before delete.
- CLI mode is non-destructive by default.
- Use
--applyonly after checking preview output.