Automatically clean up the Downloads folder

The Downloads folder on my laptop is a gathering of files. It’s the standard folder where your webbrowser saves the files you download from the web. Most of these files are only needed for a short period. The files you want te keep don’t belong in this folder. They need to be moved elsewhere, right?

Conclusion: The Downloads folder should be empty.

I made a small script which is run everytime I boot my laptop. It just removes every file or folder inside the Downloads folder. It’s one of the tweaks I love the most in my laptop.

in /etc/rc.local:

#!/bin/sh -e
# rc.local
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
# In order to enable or disable this script just change the execution
# bits.
# By default this script does nothing.
rm -rf /home/user/Downloads/*
exit 0

And make it executable with:

chmod +x /etc/rc.local

Now, every time you boot your computer the specified directory will be emptied.
Everytime I download a file which I would like to keep. I’m forced to move it right away to another folder. I can use the Downloads folder to temporarily unzip archives or build applications.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s