How to Stop Ubuntu Linux from Automatically Emptying the Trash

The Missing Files Panic

The Trash folder (or Recycle Bin) exists as a safety net. When you delete a file, you expect it to sit there indefinitely, giving you a chance to recover it if you realize a week later that you made a terrible mistake. However, to save hard drive space, modern versions of Ubuntu Linux are equipped with a background privacy tool that automatically permanently deletes files that have been sitting in the Trash for more than 30 days. If you use your Trash folder as a long-term “maybe I’ll need this” holding area, this silent, automatic deletion can lead to catastrophic data loss.

How to Disable the Auto-Empty Feature

You can easily configure Ubuntu’s system settings to leave your Trash folder entirely alone, ensuring deleted files stay there forever until you manually click “Empty Trash.”

1. Open the standard Ubuntu Settings application.

2. In the left-hand sidebar, scroll down and click on Privacy.

3. In the main pane, click on File History & Trash.

4. Look at the bottom half of the new window for the section labelled “Trash & Temporary Files.”

5. Locate the toggle switch labelled Automatically empty Trash.

6. Click the toggle switch to turn it Off.

Managing Temporary Files

Directly beneath the Trash setting, you will see a second toggle switch labelled Automatically purge Temporary Files. Temporary files are hidden system logs and cache files created by applications, and they can quickly consume gigabytes of storage space if left unchecked. While it is highly recommended to stop Ubuntu from deleting your personal Trash files, it is generally considered best practice to leave the “purge Temporary Files” setting On. This ensures your operating system remains clean, fast, and does not run out of system partition space over time.

Get the best tech tips delivered straight to your inbox.

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