How To Turn off the Trash on Ubuntu

Karthick Dkk
Jul 16, 2023

--

Photo by Gabriel Heinzer on Unsplash

Introduction:

The Trash feature in Ubuntu provides a safety net by storing deleted files and folders, allowing users to recover them if needed. However, some users may prefer to bypass the Trash and immediately delete files permanently. Disabling the Trash feature can help streamline file deletion and save storage space. In this blog post, we will walk you through the process of turning off the Trash feature on Ubuntu, giving you more control over your file management.

Default Trash Location:

~/.local/share/Trash/

we are setting the permission as immutable file on the trash folder .

Note: And also we can strict the folder for everyone using same command

Disable Trash

sudo chattr +i ~/.local/share/Trash/*

Enable Trash

sudo chattr -i ~/.local/share/Trash/*

Thanks for reading.

--

--

Karthick Dkk
Karthick Dkk

Written by Karthick Dkk

DevSecOps Engineer passionate about Linux, cloud computing, and automation. Talks about Personal Development and Money.

No responses yet