If you have an aged Linux system, chances are that you have a lot of disk space wasted due to things like application-specific caches (e.g., browser caches), system caches (e.g., apt cache), unnecessary locale files or other temporary files. With so many different ways files are generated, it is hard to track down the wasted disk usage, and free up disk space appropriately.

BleachBit is an open-source disk space cleaner software, available on Linux and Windows platforms. Besides cleaning up disk space, BleachBit can also shred files securely, and wipe out unallocated disk space for your privacy.

In this tutorial, I will describe how to clean up disk space on Linux by using BleachBit.

BleachBit Features

BleachBit has a number of features that make it an essential tool for disk cleaning and privacy protection:

A growing list of application-specific cleaners.

File shredding to prevent data recovery.

Overwrite unallocated disk space to hide traces of deleted files.

Command line interface for automated disk cleaning.

Clear the memory and swap space.

Clean up broken shortcuts.

Clean up package management systems (e.g., apt and yum).

CleanerML markup language for writing your own custom cleaners.

Install BleachBit on Linux

BleachBit's official website offers installation packages for popular Linux distributions. Download an appropriate package for your system, and install it along with its dependencies as follows. BleachBit requires Python >= 2.5 and <=2.7, and PyGTK 2.14 or later.

Folder/file whitelisting: Specify a list of paths that will be excluded from disk cleaning.

Clean Up Disk Space with BleachBit GUI

The main window of BleachBit shows a list of available cleaners in the left panel. The complete list of cleaners may vary depending on your Linux system setup, since BleachBit automatically hides irrelevant cleaners. If you click on any cleaner, you will see corresponding cleaning items.

You can selectively enable a particular cleaner and particular cleaning items underneath it.

Once you are done with cleaner selection, click on "Preview" button at the top bar. You will see a list of actions to be performed during disk cleaning, and check how much disk space will be recovered once cleaning is done.

Clean Up Disk Space from the Command Line

One nice feature of BleachBit is the fact that you can run BleachBit in command line mode. Thus you can easily schedule a cron job to clean your Linux system periodically.

Dan Nanni is the founder and also a regular contributor of Xmodulo.com. He is a Linux/FOSS enthusiast who loves to get his hands dirty with his Linux box. He likes to procrastinate when he is supposed to be busy and productive. When he is otherwise free, he likes to watch movies and shop for the coolest gadgets.