Are you running out of space in your system? This is a common problem that you often encounter because of plenty of useless files that gather almost daily and you forget to remove them from the system. Whatever OS and storage capacity you have, you should clean it from unnecessary files. Even if you have a hard disk with large storage capacity, you should clean the system. And in case you have a low storage capacity, then cleaning the system becomes the necessity. For Linux users, there are several ways to clean up the system but instead of manually doing this, we will use the open-source tool Cruftbuster that allows to automatically clean the Linux PC. It is a very useful tool that can perform actions based on user-defined criteria.

In this article, we will learn how to install and use Cruftbuster to clean a Linux PC. We will use Ubuntu 18.04 LTS for describing the procedure mentioned in this article.

Install Cruftbuster

Follow the below steps in order to install Cruftbuster in Ubuntu 18.04 LTS:

Step 1. Download Cruftbuster by using the following link:

https://code.google.com/archive/p/mirandafileorganizer/downloads

The downloaded file will be in a tar format. We will have to extract it.

Use cd command to navigate to the Downloads folder. Then run the following command to extract the tar file.

$ tar xvzf cruftbuster-0.1.Alpha2.tar

Unpack Cruftbuster

Step 2: To install Cruftbuster, we will execute Mainscreen.py file. However, before doing that, we will need to assign executable privilege to it by running the following command:

$ chmod +x MainScreen.py

Alternatively, we can assign executable privilege to Mainscreen.py by going into its Properties.

Right-click the Mainscreen.py and then click on Properties.

Make the file executable

In the Properties dialog box, go to the Permissions tab. And check the box Allow executing file as program.

Execute

Step 3: Once you have done with the permissions, run the following command in Terminal to launch Cruftbuster:

$ python MainScreen.py

It will launch Cruftbuster. Here is the default view of Cruftbuster.

Launch Cruftbuster

Using Cruftbuster

Step 1: Adding folders

In the first step, we will select the folders on which we want to apply rules. The main window is divided into two sections. Click on the + button on the left section of the application to add the folders.

Using Cruftbuster

Select as many folders as you want from the dialog box. You can also drag and drop folders. After selecting the folders, click Open.

Add folder

Once done, you will see the selected folders listed in the Folder section on the left side of the Cruftbuster window .

Step 2: Adding rules

In this step, we will create rules to tell Cruftbuster what to do with these folders. For this, click on the + button on the right section of the application window. Here you can define conditions and their corresponding actions. When the specified condition is met, action will take place.

Conditions

Following are the conditions which can be defined:

  • Name
  • Extension
  • Size
  • Date Last Modified
  • Date Last Opened
  • Date Created

Actions

Following are the actions that will be taken when the condition is met:

  • Move file
  • Copy file
  • Rename file
  • Delete file
  • Send to Recycle Bin
  • Open file

The process to add rules

following is the process for adding any rule in Cruftbuster :

1. Add a description about the rule.

2. Select ANY or ALL to apply the actions when any or all conditions are met.

2. Set the conditions. You can set multiple conditions.

3. Select the required action.

4. Enable the rule by checking the box labeled as Enabled.

5. Press OK.

Add Cleanup rule

For instance, we want to remove some .png files that contain word test in their name and their sizes are greater than 50 KB, we can do it as displayed in the following image. Check the box labeled as Enabled to apply the rules. Then click on OK to save and add the rule.

Enable rule

After adding the rule, you will see it listed in the right section of the Cruftbuster window. From this window, you can add/remove the rules, edit the rules and in case you want to disable the rule, you can do it here.

List of cruftbuster rules

In the second tab of the Cruftbuster window labeled as Recycle Bin, there is an option where you can define how often to empty the recycle bin. To enable this option, check the box labeled as Allow Cruftbuster to Manage My Recycle Bin. Add the time interval. You can specify the time interval in minutes, hours, days, and weeks.

Manage recycle bin

In the next tab labeled as Preferences, you can define how often the specified rule should be run. Only enter the time interval in seconds.

Sleeptime

That’s all there is to it! Just follow the above steps to install Cruftbuster and get rid of useless and unnecessary files. I hope it will be very helpful if you ever need to clean your Ubuntu OS.

How to Automatically Clean Your Linux PC with Cruftbuster