This is a simple bash script that can be used to perform various cleaning tasks on a Debian-based Linux system. The script performs the following actions:
- Updates the system package list and upgrades all installed packages.
- Removes and purges any orphaned packages and cleans the package cache.
- Clears the system journal logs.
- Removes the wtmp and btmp files, which store login and logout history.
- Removes all gzipped log files in the /var/log directory.
- Removes various history and cache files in the /home directory.
The script must be run as root, and will prompt the user to run as root if not already running as root.
Please note that this script is intended for use on Debian-based systems and may not work properly on other Linux distributions.
sudo ./clean.sh [-d|--deep]
The script takes one optional argument, -d
or --deep
, which when provided, causes the script to delete the Trash directory along with more cache files.
Be cautious when running this script as it will delete all the logs and history files. Make sure to backup important files before running the script.
If you have any suggestions or improvements for this script, please feel free to open a pull request or an issue on the GitHub repository.
This project is licensed under the GPL v3 License. See the LICENSE file for details