Skip to content

Latest commit

Β 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧹 Linux Cleaner β€” Advanced Academic System Optimization Tool

Version Java License Platform PRs

An advanced, academic-grade Linux system optimization and cleanup tool.
Features Bloom filter deduplication, Shannon entropy analysis, linear regression forecasting,
Pareto analysis, temporal decay scoring, and 18 specialized cleanup modules.
Supports daily scheduling via systemd timer or cron.


πŸ“‘ Table of Contents


✨ Features

  • 18 Specialized Modules β€” Temp files, caches, logs, Docker, Snap, package managers, browser caches, core dumps, orphaned symlinks, swap optimization, and more
  • Dry-Run Mode β€” Preview what would be deleted before actually cleaning
  • Academic Deep Analysis β€” Shannon entropy, Bloom filter, Pareto analysis, temporal decay scoring, linear regression forecasting
  • Daily Scheduling β€” Automatic cleanup via systemd timer or cron
  • Multi-Format Output β€” Terminal (colorized), JSON, academic reports with ASCII graphs
  • Statistical Reports β€” Mean, median, standard deviation, confidence intervals, trend analysis
  • Snapshot Tracking β€” Monitor disk usage over time with trend forecasting
  • Configuration System β€” Persistent settings via ~/.config/linux-cleaner/config.properties

πŸŽ“ Academic Methods

Method Description
Bloom Filter Space-efficient probabilistic data structure for duplicate file detection (O(1) membership test)
Shannon Entropy Information-theoretic analysis of file content randomness for cache classification
Exponential Temporal Decay Half-life-based scoring model for file access recency (30-day half-life)
Linear Regression Ordinary least squares estimation for disk usage trend prediction
Pareto Analysis 80/20 rule application to identify the most impactful cleanup targets
Monte Carlo Estimation Probabilistic risk assessment for cleanup operations
Statistical Summary Descriptive statistics with 95% confidence intervals

πŸ“¦ Installation

Prerequisites

  • Java 21+ (or newer)
  • Linux (tested on Ubuntu, Fedora, Arch Linux, Debian)

Option 1: Download JAR

# Download the latest release
wget https://github.com/gokalpbildirici/linux-cleaner/releases/latest/download/linux-cleaner.jar

# Make it executable (optional)
chmod +x linux-cleaner.jar

# Create an alias
alias linux-cleaner='java -jar /path/to/linux-cleaner.jar'

Option 2: Build from Source

git clone https://github.com/gokalpbildirici/linux-cleaner.git
cd linux-cleaner
mvn clean package
alias linux-cleaner='java -jar target/linux-cleaner.jar'

Option 3: Install System-Wide

sudo wget -O /usr/local/bin/linux-cleaner.jar https://github.com/gokalpbildirici/linux-cleaner/releases/latest/download/linux-cleaner.jar
echo 'alias linux-cleaner="java -jar /usr/local/bin/linux-cleaner.jar"' >> ~/.bashrc
source ~/.bashrc

πŸš€ Usage

linux-cleaner <command> [options]

Quick Start

# Scan the system (dry-run, no deletion)
linux-cleaner scan

# Run full cleanup
linux-cleaner clean -f

# Generate an academic report
linux-cleaner report -a --output report.txt

# Set up daily scheduling
linux-cleaner schedule --type systemd

πŸ“‹ Commands

Command Description
scan Scan the system and list cleanable files
clean Perform cleanup
report Generate academic optimization report
schedule Set up daily automatic scheduling
daemon Background process called by scheduler
analyze Deep academic analysis (Pareto, entropy, temporal)
forecast Disk usage trend prediction (linear regression)
status Show system status
benchmark Module performance benchmark
config View/modify configuration
help Show this help message

Options

Flag Description
-n, --dry-run Preview without deleting
-v, --verbose Verbose output
-j, --json JSON output format
-f, --force Skip confirmation
-q, --quiet Quiet mode
-a, --academic Academic mode (detailed report)
-m, --module <name> Run specific modules (comma-separated)
-c, --config <file> Config file path
-o, --output <file> Write output to file

🧩 Modules

Module Description
temp Temporary files (/tmp, /var/tmp)
thumbnails Thumbnail caches (~/.thumbnails)
cache User cache (~/.cache)
logs Old log files (/var/log)
journal Systemd journals
packages Package manager cache (apt, dnf, pacman)
trash Trash (~/.local/share/Trash)
kernels Old kernel images
docker Docker system prune
snap Snap package cache
browsers Browser caches (Chrome, Firefox, Chromium, etc.)
duplicates Duplicate file detection (Bloom Filter)
pip Python pip cache
npm Node.js npm cache
maven Maven local repository snapshots
coredump Core dump files
orphans Broken symbolic links
swap Swap optimization

⏰ Scheduling

systemd (Recommended)

# Auto-detect and set up
linux-cleaner schedule --type auto

# Explicit systemd timer
linux-cleaner schedule --type systemd --time 03:00

# Remove scheduling
linux-cleaner schedule --remove

cron

linux-cleaner schedule --type cron --time 03:00

βš™οΈ Configuration

Configuration is stored at ~/.config/linux-cleaner/config.properties.

# List all settings
linux-cleaner config --list

# Get a specific setting
linux-cleaner config --get cleaner.temp.age-hours

# Change a setting
linux-cleaner config --set cleaner.temp.age-hours 48 --value 48

# Reset to defaults
linux-cleaner config --reset

Key Configuration Options

Key Default Description
cleaner.temp.age-hours 24 Delete temp files older than N hours
cleaner.journal.age-days 7 Vacuum journals older than N days
analyzer.dedup-enabled true Enable Bloom filter deduplication
analyzer.entropy-enabled true Enable Shannon entropy analysis
scheduler.type none Scheduler type (systemd, cron, none)
scheduler.time 03:00 Scheduled run time
report.academic-mode true Enable academic detailed reports

πŸ’‘ Examples

# Quick scan
linux-cleaner scan

# Preview cleanup (dry-run)
linux-cleaner clean -n

# Force cleanup without confirmation
linux-cleaner clean -f

# Academic report saved to file
linux-cleaner report -a -o /tmp/cleaner-report.txt

# Scan only specific modules
linux-cleaner scan --module temp,logs,journal

# JSON output for scripting
linux-cleaner scan -j | jq '.totalScanned'

# Disk usage forecast
linux-cleaner forecast

# Deep analysis
linux-cleaner analyze

# Performance benchmark
linux-cleaner benchmark

# Set up daily scheduler
linux-cleaner schedule --type systemd

# View configuration
linux-cleaner config --list

πŸ“ Project Structure

linux-cleaner/
β”œβ”€β”€ pom.xml                          # Maven build configuration
β”œβ”€β”€ README.md                        # This file (English)
β”œβ”€β”€ README.tr.md                     # Turkish
β”œβ”€β”€ README.de.md                     # German
β”œβ”€β”€ README.ru.md                     # Russian
β”œβ”€β”€ .gitignore
└── src/
    └── main/
        └── java/org/yourcompany/yourproject/
            β”œβ”€β”€ Main.java            # CLI entry point
            β”œβ”€β”€ Cleaner.java         # Cleaning engine (18 modules)
            β”œβ”€β”€ Config.java          # Configuration management
            β”œβ”€β”€ Optimizer.java       # Academic optimization engine
            β”œβ”€β”€ ReportGenerator.java # Academic report generator
            └── Scheduler.java       # systemd/cron scheduler

πŸ”§ Building from Source

# Requirements: Java 21+, Maven 3.6+
git clone https://github.com/gokalpbildirici/linux-cleaner.git
cd linux-cleaner
mvn clean package

# Run directly
java -jar target/linux-cleaner.jar scan

# Or use Maven exec plugin
mvn exec:java -Dexec.args="scan -n"

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.


🌐 Translations


About

🧹 Advanced academic Linux system optimization tool β€” Bloom filter dedup, Shannon entropy, linear regression, Pareto analysis, 18 modules, multi-language

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages