The trash (or "Recycle bin") is a sane concept of our operating systems. A file sent to the trash can be recovered if the user realizes the file was still needed after all. Now, the problem is: when should you empty the trash?
Linux users, rejoice! Enter Autotrash. The name may sound a little scary, but this tiny command-line Python application is actually very friendly and fully solves the problems I just exposed. Its humble task is to selectively purge your trash based on certain criteria that you specify, like Deletion date, Remaining disk space, or Regular expressions.
Edit 2010/04/14: Windows users, Martin found a great app for you, read his followup article.
For example, you can tell Autotrash to delete files that have been in the trash for more than 7 days ago, and to ensure that at least 10GB remain available:
This means our three problems are solved:
The next question you'll probably ask is: "Great, but I don't want to have to run Autotrash manually, how do I setup a schedule?". In typical GNU style, Autotrash doesn't do that, and it's okay because it's not its job. To do the scheduling, I suggest that:
The most straightforward way to install Autotrash on an Ubuntu machine is to use its PPA. Inside a terminal, enter:
sudo add-apt-repository ppa:bneijt/ppa && sudo apt-get update && sudo apt-get install autotrash
Once the installation is done, open the manual page to see what it can do, and do your own setup:
Ronan is a geek and musician living in Montreal. He enjoys days when his hard drive doesn't evaporate because of an accidental keystroke and rambles about software, music and life at flying molehill.Advertisement
Ghacks is a technology news blog that was founded in 2005 by Martin Brinkmann. It has since then become one of the most popular tech news sites on the Internet with five authors and regular contributions from freelance writers.