Ubuntu – BleachBit Command Line To Clean All Options

bleachbitcommand line

Related to this question: Clearing Firefox History via Command Line

In my last question (link above), I asked if there is a way to clean all in the Firefox options of BleachBit. I'm writing a script that will clean my computer before I reinstall or install Ubuntu (I'm just like starting fresh). There is a way but is there a command to clean all options instead of doing each (–clean [insert option from bleachbit –list here] *) one by one? Or does that option not exist?

Best Answer

The command bleachbit --clean *.* is generally not recommended, so it is not implemented in BleachBit. However, power users can get the same effect with the following mini-script:

bleachbit --list | grep -E "[a-z0-9_\-]+\.[a-z0-9_\-]+" | xargs bleachbit --clean

Please note this command ignores all warnings!

You can filter options by adding another grep before xargs. For example, this may save you a few hours:

bleachbit --list | grep -E "[a-z0-9_\-]+\.[a-z0-9_\-]+" | grep -v system.free_disk_space | xargs bleachbit --clean

Reference: BleachBit forum: Command line: delete everything