How To Empty the Ubuntu Gnome Trash from the Command Line
Ubuntu has a trash can/recycle bin feature similar to windows. The difference with Ubuntu is that you can empty the trash from the command line.
Here’s the full trash icon, in the lower right hand corner:
Just open a terminal and type in the following command:
rm -rf ~/.Trash/*
Trash has been taken out!
![]()
This article was originally written on 12/13/06

Daily Email Updates
You can get our how-to articles in your inbox each day for free. Just enter your name and email below:


Thank you for this. There was some old src files in my bin that I didn’t have permission to delete (I don’t know how), and with this command all I had to do was add a sudo in front and it worked brilliantly! Cheers!
heheh, ofcourse!, .Trash!!!!!!!, where else would it be!? i was looking for that damn directory for a long time!.
I can’t get this to work in 7.10. Has the command changed?
not working on Ubuntu Hardy
i found a fix here
http://ubuntuforums.org/showthread.php?p=5014310
User trash is in /home/username/.local/share/Trash
Root trash is in /root/.local/share/Trash
There are usually 2 subfolders in each of these, ‘files’ and ‘info’
Yeah i got mine to work using the command: sudo rm -rf ‘/home/username/.local/share/Trash’ on Ubuntu 8.04. Thanks a bunch as I needed this since I put files into the trash that were read-only, so then I didn’t have permission to delete my own files. Damn I hate permissions sumetimes.
For those of you who could not find the solution try this
In the command line type the following
$sudo nautilus /home/[your user folder]
After this a window will open then view the hidden files using Ctrl+h and go to .local/share/Trash/files
There you will find the files that are in trash remove it directly…
This is found in ubuntu 8.04
Oh already Joel has told that any way i am submitting it. Only after typing it i found it.
LoL, he was type it 6 days before you…..
sudo rm -rf ‘/home/username/.local/share/Trash’ on Ubuntu 8.04
thanks alot…
Just in case anyone was blissfully unaware, the command
sudo rm -rf ~/.Trash/*
means, remove recursively(include subfolders, and subsubfolders etc.) forceably(dont ask me for confirmation) everything in this folder(The * is a wildcard meaning it matches ‘everything’ in the folder)
so whatever you do, dont do
sudo rm -rf /*
unless you want to loose all your data
Bodsda