Is there any way to configure Ubuntu to permanently delete files from trash after a certain amount of time?
I don't get why that's not the default behavior in any major OS. I don't want to think about administrating my trash, but I don't want to accidentally delete something either. Am I the only one with that opinion?
Use trash-cli (click image to install or run
sudo apt-get install trash-cli
).Run
trash-empty 30
to remove all files from trash which are older than 30 days. (You can change this number as you like.)To automate this, add a command to Startup Applications:
Please note: If you use older Ubuntu versions than 12.04, the command is
empty-trash
!If you're on GNOME, there's now a feature for that! Go to Privacy in your settings and look under Purge Trash & Temporary Files.
More at https://help.gnome.org/users/gnome-help/stable/privacy-purge.html.en.
Try with Autotrash!
Autotrash is a simple Python script comes with Ubuntu 10.10 Maverick Meerkat which will purge files from your trash when they become older than a given days,purge older files to ensure a specific amount of disk space is free,etc.It uses the FreeDesktop.org Trash Info files included in the new GNOME system to find the correct files and the dates they where deleted.
Features:
For more info,execute this in terminal:
autotrash --help
AutoTrash is already in Ubuntu 10.10′s repository,it can be installed from Ubuntu Software Center.For Ubuntu 10.04 and 9.10 user,install this from PPA:
Info: http://www.logfish.net/pr/autotrash/
Source: http://ubuntuguide.net/automatically-delete-files-older-than-n-days-from-trash-using-autotrash/
For a different approach and a more comprehensive guide: http://helpdeskgeek.com/linux-tips/automatically-empty-the-trash-in-ubuntu/