The Premature Purge
Ubuntu includes built-in privacy and housekeeping features designed to keep your system clean without manual intervention. One of these features targets the Trash bin. By default, Ubuntu can be configured to automatically delete files from the Trash once they have been sitting there for a specific number of days (usually 30). While this is great for freeing up hard drive space, many users use the Trash bin as a temporary holding area—a safety net for files they aren’t quite sure they want to permanently destroy yet. Having the operating system silently purge these files in the background can lead to accidental data loss.
Disabling the Trash Timer
To preserve your deleted files indefinitely and stop Ubuntu from automatically deleting files in the Trash, you must disable the auto-empty timer in the Privacy settings.
Open your main application launcher and search for Settings. In the left-hand navigation sidebar, scroll down and click on Privacy & Security (or just “Privacy” in older versions). In the right-hand panel, look for a section named File History & Trash (or “Purge Trash & Temporary Files”). Click on it to expand the options. You will see a toggle switch explicitly labelled Automatically Empty Trash. If this is active, click the toggle to turn it Off. (You will also see a setting here for temporary files, which you can manage similarly). Your Trash bin will now function like a standard folder, retaining all deleted files forever until you manually right-click the icon and select “Empty Trash.”