Like CCleaner on Windows, BleachBit frees space by deleting unimportant files and helps maintain your privacy by deleting sensitive data. And, just like CCleaner, there’s more you can do with BleachBit than just clicking a single button.
BleachBit is available in Ubuntu’s Software Center and most other Linux distributions’ software repositories. You can also download it from the BleachBit website – it even runs on Windows, too.
Select the type of data you want to remove in BleachBit’s sidebar after launching it. Unlike CCleaner, BleachBIt doesn’t automatically select or recommend certain types of data to delete. BleachBit works with system-wide data as well as application-specific data – for example, for web browsers such as Firefox.
BleachBit warns you if you select an option that’s slow or may have other problems.
You should run a preview by clicking the Preview button before running an actual Clean operation. Verify that Bleachbit isn’t deleting any important files you want to keep.
Instead of deleting files normally, you can go into BleachBit’s preferences window (Edit –> Preferences) and enable the Overwrite files to hide contents option. This is equivalent to “shredding” files, as some programs refer to it. Programs normally delete files by marking them as deleted, leaving them on the disk for file-recovery utilities to potentially recover. The overwrite option overwrites the files with useless data, preventing recovery. The files may still be recoverable if a copy of them existed elsewhere on the system and that copy wasn’t overwritten, so there’s no guarantee that the data will be completley unrecoverable if you overwrite it – nevertheless, if you’re worried about file-recovery utilities, this is a helpful feature. The downside is that overwriting files is significantly slower than just marking them as deleted, which is why operating systems don’t overwrite all deleted files in the first place.
Wiping Free Disk Space
Like CCleaner, BleachBit includes an option to overwrite free disk space with useless data. This overwrites deleted files that are lurking in the free disk space, ensuring files deleted by other applications are overwriten. To enable this feature, use the Drives tab in the Preferences window to add a writable folder on each partition on your system. If you only have a single drive, the default settings will work fine. If you have a different partition mounted at /partition, you’ll need to add a folder inside /partition to this list.
After configuring the options on the Drives tab, enable the Free disk space option under System. As you’d expect, this option is very slow – so BleachBit warns you.
Quick Shredding & Wiping
You can also shred individuals files and folders and wipe partitions from BleachBit’s File menu. Select Shred Files, Shred Folders, or Wipe Free Space to run an operation immediately.
Deleting System Files
If you try to remove system files like localizations (see below) or APT package data, you’ll see permission-denied errors if you’re running BleachBit as your standard user account.
BleachBit has no built-in way of asking for elevated privileges. To delete these files, you’ll need to run BleachBit as root – you may have a BleachBit as Administrator option in your menu. If you don’t have this option – for example, on Ubuntu – you’ll need to run BleachBit as root manually. To do this on Ubuntu, close BleachBit, press ALT+F2, type gksu bleachbit, and press Enter.
Once it’s launched, you can delete APT cache data, localizations, and other data in system directories. One caveat – BleachBit won’t see your personal data while running as root. You’ll need to close the BleachBit window and run BleachBit normally to delete your browser data and other user-specific data.
Your system probably has localization files for a wide variety of languages on it. While this normally isn’t a huge problem and doesn’t take up a large amount of disk space, it does use some. For example, on a fairly standard Ubuntu 12.04 system, BleachBit offers to delete 54MB of language files with its default settings. If you’re feeling squeezed for space, deleting language files can free up a bit. To use this feature, enable the Localizations option under System.
You can select the languages you want to keep on the Languages tab in the Preferences window. Just check the languages you want to keep – BleachBit will remove everything else.
If you’re deleting system data to free up space, you should also check out the APT category near the top of the window to remove unneeded software packages.
BleachBit has a command-line interface, too. From a terminal window, you can run bleachbit -l to list all available cleaners.
Use the bleachbit -c command, followed by a list of cleaners, to run the cleaners. For example, to run all Firefox cleaners and delete your Chromium browser history, you’d run the following command:
bleachbit -c firefox.* chromium.history
Like other terminal commands, you could integrate this command into a script to run BleachBit automatically in the background.