Thanks to visit codestin.com
Credit goes to github.com

Skip to content

🐹 Dig deep like a mole to clean your Ubuntu - fork from tw93/mole

Notifications You must be signed in to change notification settings

comchienlab/fub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

55 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Fub

Dig deep to clean your Ubuntu system.

Features

  • Deep System Cleanup - Deep system cleaning - caches, logs, temp files, APT/Snap/Flatpak cleanup, telemetry removal
  • Thorough Uninstall - Multi-package manager support (APT, Snap, Flatpak, AppImage) with fzf fuzzy finder
  • System Optimization - Performance tuning, cache rebuilds, TLP/auto-cpufreq power management for laptops
  • Interactive Disk Analyzer - Navigate folders with arrow keys, find and delete large files quickly
  • Swap File Manager - Create/manage swap files with interactive size selection
  • Security Hardening - UFW firewall and Fail2Ban setup with sensible defaults
  • Startup Manager - Enable/disable auto-start programs to improve boot time
  • Fast & Lightweight - Terminal-based with fzf fuzzy finder, arrow-key navigation, and batch operations

Quick Start

Install:

curl -fsSL https://raw.githubusercontent.com/tw93/mole/main/install.sh | bash

Or via Homebrew:

brew install tw93/tap/mole

Run:

fub                      # Interactive menu (7 options)
fub clean                # System cleanup
fub clean --dry-run      # Preview mode
fub clean --whitelist    # Manage protected caches
fub uninstall            # Uninstall apps (APT, Snap, Flatpak, AppImage)
fub optimize             # System optimization & performance tuning
fub analyze              # Disk analyzer
fub swap                 # Swap file manager
fub security             # Security hardening (UFW, Fail2Ban)
fub startup              # Startup applications manager

fub touchid              # Configure Touch ID for sudo (macOS only)
fub update               # Update Fub
fub remove               # Remove Fub from system
fub --help               # Show help
fub --version            # Show installed version

Tips

  • Safety first, if your Ubuntu system is mission-critical, wait for Fub to mature before full cleanups.
  • Preview the cleanup by running fub clean --dry-run and reviewing the generated list.
  • Use fub clean --whitelist to manage protected caches.
  • Use fub touchid to approve sudo with Touch ID instead of typing your password.

Features in Detail

Deep System Cleanup

$ fub clean

Scanning cache directories...

  βœ“ User app cache                                           45.2GB
  βœ“ Browser cache (Chrome, Safari, Firefox)                  10.5GB
  βœ“ Developer tools (Xcode, Node.js, npm)                    23.3GB
  βœ“ System logs and temp files                                3.8GB
  βœ“ App-specific cache (Spotify, Dropbox, Slack)              8.4GB
  βœ“ Trash                                                     12.3GB

====================================================================
Space freed: 95.5GB | Free space now: 223.5GB
====================================================================

Smart App Uninstaller

$ fub uninstall

Select Apps to Remove
═══════════════════════════
β–Ά β˜‘ Adobe Creative Cloud      (12.4G) | Old
  ☐ WeChat                    (2.1G) | Recent
  ☐ Final Cut Pro             (3.8G) | Recent

Uninstalling: Adobe Creative Cloud

  βœ“ Removed application
  βœ“ Cleaned 52 related files across 12 locations
    - Application Support, Caches, Preferences
    - Logs, WebKit storage, Cookies
    - Extensions, Plugins, Launch daemons

====================================================================
Space freed: 12.8GB
====================================================================

System Optimization

$ fub optimize

System: 5/32 GB RAM | 333/460 GB Disk (72%) | Uptime 6d

  βœ“ Rebuild system databases and flush caches
  βœ“ Reset network services
  βœ“ Refresh Finder and Dock
  βœ“ Clean diagnostic and crash logs
  βœ“ Purge swap files and restart dynamic pager
  βœ“ Rebuild launch services and spotlight index

====================================================================
System optimization completed
====================================================================

Disk Space Analyzer

$ fub analyze

Analyze Disk  ~/Documents  |  Total: 156.8GB

 β–Ά  1. β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  48.2%  |  πŸ“ Library                     75.4GB  >6mo
    2. β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘  22.1%  |  πŸ“ Downloads                   34.6GB
    3. β–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘  14.3%  |  πŸ“ Movies                      22.4GB
    4. β–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘  10.8%  |  πŸ“ Documents                   16.9GB
    5. β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘   5.2%  |  πŸ“„ backup_2023.zip              8.2GB

  ↑↓←→ Navigate  |  O Open  |  F Reveal  |  ⌫ Delete  |  L Large(24)  |  Q Quit

Swap File Manager

$ fub swap

Current Memory Status
═══════════════════════════════════════════════
  RAM:         Total: 8.0G | Used: 2.5G | Free: 5.5G
  Swap:        No swap file configured

Select swap file size:
β–Ά 2GB
  4GB
  8GB
  16GB
  32GB
  Custom
  Remove Swap
  Cancel

Creating 8GB swap file...
  β†’ Creating 8GB swap file (this may take a moment)...
  β†’ Setting permissions...
  β†’ Formatting as swap...
  β†’ Enabling swap...
  β†’ Adding to /etc/fstab for persistence...

βœ“ Swap file created successfully!

Security Hardening

$ fub security

Current Security Status
═══════════════════════════════════════════════
  UFW Firewall:    Not installed
  Fail2Ban:        Not installed
  SSH Server:      Running

Select security action:
β–Ά Setup UFW Firewall
  Setup Fail2Ban
  Show UFW Rules
  Show Fail2Ban Status
  Exit

Setting up UFW Firewall...
  β†’ Installing UFW...
  β†’ Configuring default policies...
  β†’ Allowing SSH (port 22)...

Allow HTTP (port 80)? [y/N]: y
  βœ“ HTTP allowed

βœ“ UFW Firewall configured and enabled!

Startup Applications Manager

$ fub startup

Startup Applications Status
═══════════════════════════════════════════════
  Total:      12 startup applications
  Enabled:    8 active
  Disabled:   4 inactive

  User apps:   5 applications
  System apps: 7 applications

Select action:
β–Ά Disable Apps
  Enable Apps
  Remove User Apps
  List All Apps
  Exit

Select startup apps to DISABLE: (Tab: select, Ctrl-A: all)
β–Ά β˜‘ [ENABLED ] [USER  ]  Dropbox
  ☐ [ENABLED ] [SYSTEM]  GNOME Keyring
  β˜‘ [ENABLED ] [USER  ]  Slack Startup

Disabling startup applications...
  βœ“ Disabled: Dropbox
  βœ“ Disabled: Slack Startup

βœ“ Disabled 2 startup application(s)

Environment Variables

Fub supports environment variables for non-interactive configuration:

Clean Command

FUB_REMOVE_BLOAT=true       # Remove bloatware packages (gnome-games, etc.)
FUB_REMOVE_TELEMETRY=true   # Disable Ubuntu telemetry (apport, whoopsie)
FUB_CLEAR_PRIVACY_LOGS=true # Clear privacy logs (default: true)

Optimize Command

FUB_INSTALL_NERDFONTS=true    # Install Nerd Fonts (JetBrains, FiraCode, etc.)
FUB_INSTALL_TLP=true          # Install TLP power management (laptops only)
FUB_INSTALL_AUTOCPUFREQ=true  # Install auto-cpufreq (alternative to TLP)

Swap Command

FUB_SWAP_SIZE=8               # Create swap file with specified size in GB

Security Command

FUB_SETUP_UFW=true            # Auto-setup UFW firewall
FUB_SETUP_FAIL2BAN=true       # Auto-setup Fail2Ban

Example Usage

# Deep privacy cleanup
FUB_REMOVE_TELEMETRY=true FUB_REMOVE_BLOAT=true fub clean

# Full laptop optimization
FUB_INSTALL_TLP=true FUB_INSTALL_NERDFONTS=true fub optimize

# Create 16GB swap file
FUB_SWAP_SIZE=16 fub swap

# Auto-configure security
FUB_SETUP_UFW=true FUB_SETUP_FAIL2BAN=true fub security

Quick Launchers

Launch Fub commands instantly from Raycast or Alfred:

curl -fsSL https://raw.githubusercontent.com/tw93/Fub/main/scripts/setup-quick-launchers.sh | bash

Adds 4 commands: clean, uninstall, optimize, analyze. Auto-detects your terminal or set MO_LAUNCHER_APP=<name> to override.

About

🐹 Dig deep like a mole to clean your Ubuntu - fork from tw93/mole

Resources

Stars

Watchers

Forks

Sponsor this project

  •  

Contributors 3

  •  
  •  
  •