How to Stop Ubuntu Linux from Automatically Cleaning the Trash

The Safety Net Expiration

The “Trash” (or Rubbish Bin) in Ubuntu is designed as a safety net. When you delete a file, it isn’t permanently erased from your hard drive; it is moved to the Trash so you can recover it if you made a mistake. However, to prevent your hard drive from filling up indefinitely, modern versions of Ubuntu are configured to automatically empty the Trash on a rolling 30-day schedule. Any file that has been sitting in the bin for more than a month is permanently deleted without any further warning. If you treat the Trash as a temporary storage folder rather than a true deletion queue, this automatic expiration can lead to catastrophic data loss.

How to Disable Automatic Trash Emptying

You can easily disable this scheduled cleanup within the GNOME Settings, ensuring that files remain in the Trash forever until you manually click “Empty Trash.”

1. Click on the system menu in the top-right corner of your screen (where the power and network icons are).

2. Click on the Settings icon (the gear).

3. In the left-hand navigation sidebar, click on Privacy.

4. In the main pane, click on File History & Trash (on some versions, this may just be labelled “Trash”).

5. Look for the toggle switch labelled Automatically Empty Trash.

6. Click the toggle switch to turn it Off.

With this setting disabled, the 30-day timer is removed. Your deleted files will sit in the Trash bin permanently, giving you ultimate control over when data is actually scrubbed from your drive.

Adjusting the Time Limit (Alternative)

If you don’t want to completely disable the feature (because you know you will never remember to manually empty the bin), you can simply extend the grace period.

In the same “File History & Trash” settings menu, leave the main toggle turned ON. Look directly below it for the setting labelled Empty Trash After. Click the drop-down menu and change it from the default 30 days to something more forgiving, such as 60 days or 90 days. This provides a much longer safety net while still ensuring your hard drive doesn’t eventually fill up with years of deleted files.

Get the best tech tips delivered straight to your inbox.

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