/Clean-My-Linux

A script to clean Linux work environment and save you some space!

Primary LanguageShellGNU General Public License v3.0GPL-3.0

Clean-My-Linux

A script to clean-up your Linux work enviroment.

  1. Clone the repo: git clone https://github.com/Mostafa-wael/Clean-My-Linux.git
  2. Go to the script: cd Clean-My-Linux/
  3. Give the script the required permissions: chmod u+x clean
  4. Add it to your binaries: sudo cp ./clean /usr/local/bin
  5. To solve some permission issues: sudo chown -R $(whoami) /usr/local/bin/clean
  6. Finally, run: sudo clean

Check the storage before and after!

Script Updated Version

The script does the following:

  • Clean all the log files.
  • Clean systemd journal logs.
  • Clean the thumbnail cache.
  • Free up space by cleaning out the cached packages.
  • Getting rid of partial packages.
  • Getting rid of no longer required packages.
  • Remove Any Automatic Dependencies that are No Longer Needed with all of the associated configuration files from the dependencies.
  • Getting rid of orphaned packages.
  • Remove the Trash.
  • Remove Man.
  • Delete all .gz and rotated file.
  • Cleaning the old kernels.
  • Removes old revisions of snaps(leaves only 2 versions).

Enjoy the free space!