How to Stop Ubuntu from Automatically Clearing the Trash

The 30-Day Limit

Ubuntu includes a built-in privacy and storage management feature designed to keep your hard drive clean. By default, any file you move to the Trash bin is not kept indefinitely; Ubuntu will automatically permanently delete files that have been sitting in the Trash for more than 30 days. While this prevents your hard drive from silently filling up with gigabytes of forgotten data, it can be disastrous if you use the Trash bin as a temporary holding area and accidentally lose a critical file simply because the 30-day timer expired before you realized you needed to recover it.

Preserving Deleted Files

To ensure your deleted files are kept safely until you explicitly decide to remove them, and stop Ubuntu from automatically clearing the Trash bin, you must adjust the system’s privacy settings.

Click the system menu in the top-right corner of your screen and open Settings. In the left-hand navigation sidebar, scroll down and click on Privacy. In the right-hand panel, click on File History & Trash. Look for the section labelled “Trash & Temporary Files.” You will see a toggle switch for Automatically Delete Trash Content. Click this toggle switch to turn it Off. With this disabled, files moved to the Trash will remain there forever, safely waiting until you manually right-click the Trash icon and select “Empty Trash.”

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.