Ubuntu / Linux news and application reviews.

Directory cleaner and files organizer

In my search for a clean Desktop (because I got tired of cleaning it manually), I came across "Directory cleaner and files organizer", a script (with Zenity for a GUI) that automatically cleans any directory (and thus the Desktop folder) by moving the files to various folders such as all the pictures into ~/Pictures, the archives into ~/Archives, documents into ~/Documents and so on.

The script recognizes more than 470 extensions and the directories where it moves the files can be customized in the settings. Also, I'm using it for organizing my Desktop but you can use it for any other folder such as the ~/Downloads folder and so on.

Directory cleaner and files organizer has 2 options for cleaning: "Start-Cleaning" which moves all the files in the selected directory to the directories you've set in its settings, overwriting any existing files, and "Advanced-Cleaning" which is a smart way of moving the files:
  • if the file that's going to be moved already exists in the destination folder, a new folder with its extension is created and the file is moved into that folder.
  • if that folder also has a file with the same name, the file is renamed using the date and time so the file never gets overwritten


Installation

Before proceeding with the installation, remember to always check the source of any script you run on your computer!

Directory cleaner and files organizer only depends on Zenity which should already be installed. To install Directory cleaner and files organizer, download if from HERE, extract it and double click the "install.sh" file.

Once installed you can find it under Accessories > Files-Oraganizer.


Configuring Directory cleaner and files organizer

Directory cleaner and files organizer clean paths can be configured. By default, selecting "Edit-Settings" will pop up the following configuration:

Edit path's for your files with exact order
-----------------------------------------------------
/home/YOUR_USERNAME/Pictures
/home/YOUR_USERNAME/Music
/home/YOUR_USERNAME/Documents
/home/YOUR_USERNAME/Videos
/home/YOUR_USERNAME/Archives
/home/YOUR_USERNAME/Scripts

You can get an idea on what each folder is for (therefore I won't get into detail here since it's obvious), so you can easily modify it to point to some other location.


Directory cleaner and files organizer is not 100% automated as you have to run it and select the folder you want it to clean. But if you know a bit of Bash, you can always tweak it so you can launch it via command line (without Zenity) and then add it to an hourly cron job.