Use Your Temp Folder To Automatically Clean Old Downloads For You

If you've ever opened your Downloads folder only to find heaps of files you don't need, Lifehacker reader Márton Mészáros has a simple tip for keeping yourself organised: use your computer's temporary folder.

If you use your temporary folder, it will empty out those old files for you every time you restart:

For long, I've had a massive download folder. I just kept on accumulating stuff. Installers, pictures, music, whatever. I've ended up with TBs of mixed material, which I needed to sort out when my computer was complaining about not enough free space.

For starters, I forced myself to delete everything after I've installed it/viewed it/heard it. It requires huge discipline, and you'll eventually delete the whole folder when your computer needs more space.

Fortunately as a Linux user, I've found a really handy solution. Ever since I've discovered this, I have this problem no more, and it doesn't require me to grow superhuman discipline or to do anything extremely different. All I do now is that I set my download folder to /tmp.

Easy isn't it? If something is important enough to save it for later use, I have to manually move it out from the temp. If it's not as important, it will be deleted upon a reboot. This works for Macs too, though Windows users will have to find another solution.

Windows users could always set their download folders to something like C:\Temp, but Windows isn't nearly as good about emptying its temporary folders as OS X and Linux are. If you want to automatically keep your Downloads folder clean, you could always just use something like Belvedere to automate and organise your folders.


Comments

    If you don't feel quite hardcore enough to store everything in the temp folder, you can use cron to set a maximum time limit For example, add this to your crontab and once an hour it'll remove anything from the specified folder that's more than a week old:

    * */1 * * * find /home/username/downloads -type d -mtime +7 -exec rm -Rf {} \;

    It gives you a little more leeway for suddenly realising you needed that file after all, but keeps things nice and clean.

    Last edited 19/01/13 3:42 pm

Join the discussion!

Trending Stories Right Now