Skip to content

raghav3615/cleansh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Disk Cleanup Utility (Dialog + Bash)

clean.sh is a safe disk cleanup utility with a Dialog TUI and optional CLI mode.

Features

  • 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 --apply is passed
  • Logs written to ./logs/

Requirements

  • Bash 4+
  • find, xargs, awk, sort, wc
  • dialog (required for TUI only)

Install dialog:

  • Debian/Ubuntu: sudo apt-get install dialog
  • RHEL/CentOS: sudo yum install dialog
  • macOS (Homebrew): brew install dialog

Run

Make it executable:

chmod +x clean.sh

Launch Dialog TUI:

./clean.sh

CLI mode

You can run actions directly without TUI.

Preview only:

./clean.sh --find-large
./clean.sh --clean-temp
./clean.sh --clear-cache
./clean.sh --all

Apply cleanup (for temp/cache actions):

./clean.sh --clean-temp --apply
./clean.sh --clear-cache --apply
./clean.sh --all --apply

Custom 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

Safety notes

  • TUI always previews and asks for confirmation before delete.
  • CLI mode is non-destructive by default.
  • Use --apply only after checking preview output.

About

Safe disk cleanup utility with a Dialog TUI and optional CLI mode.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages