Simple tip to auto-clean your trash

auto clean trash linux ubuntu

I download a lot of movies using torrents everyday. And after finishing watching the movies or installing stuffs, I usually delete the downloaded files using the option of Transmission. However, one thing I just noticed today is that when you use the option "Delete Files and Remove" on Transmission, the files arent permanently deleted but moved to the trash folder. In short, there were a lot of undeleted files in my trash that I was unaware of until today. So I came up with a simple method to auto-clean up the trash everyday.

The command is very simple, here is it:
 rm -r /home/username/.local/share/Trash/files/*  

To make it autorun, you can use the crontab trick. The command to put into the crontab schedule to clean the trash daily will be:
 @daily rm -r /home/username/.local/share/Trash/files/*  

In case you dont like using crontab, you can just use the Startup Application Preferences and copy-paste the command above into the Command section to auto-clean the trash whenever you boot up your computer:

auto clean trash linux
linux tips and tricks