Skip to main content

How to forcefully clear the Trash in Linux

· One min read

The Trash stores your recently deleted files and folders which you can usually Right click and clear to clear the Trash in Linux  – however I have ran into problems where even though you clear the Trash the files and folders you want deleted remain. Good news is that you can force the Trash to be cleared by using the Linux terminal.

  1. Open your Linux Terminal
  2. Copy these commands and paste them into the terminal and press Enter (this will clear the Trash completely – anything in the Trash is unable to be recovered)

 

rm -rf ~/.local/share/Trash

mkdir ~/.local/share/Trash

mkdir ~/.local/share/Trash/expunged

mkdir ~/.local/share/Trash/files

mkdir ~/.local/share/Trash/info

 

Note: Tested in Debian/Ubuntu variant – other Linux distributions may have the Trash location changed and you will need to find the Trash location on your Linux distribution.