Unix/Linux: How to empty your Trash using terminal commands

Is there a time when you want to delete all your file from the Trash. If you are a linux user you can do it using the user interface (right click and “Empty trash”) or you can use the terminal commands.

The first one, with “Empty Trash” option can be used only if you have the write permissions on all files from your trash. What if you have some other files that you can’t open, or delete?

This is when terminal commands are brilliant. To empty you Trash using commands you need super user permisions.

1. Open a terminal

2. Login as a super user. Type:

su

and enter your root password

3. Browse to Trash directory. Type

cd .Trash

4. Remove all files and folders. Type

rm -rf *

And that should be all. Type exit to exit the terminal.

very helpful I am a raspberry pi user and the Trash I wanted to empty was in /mnt/share/tv/.Trash-0 it worked perfectly