SEARCH

How-To Geek

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!

Lowell Heddings, better known online as the How-To Geek, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on if you'd like.

  • Published 12/13/06

Comments (11)

  1. Sayne

    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!

  2. mozey

    heheh, ofcourse!, .Trash!!!!!!!, where else would it be!? i was looking for that damn directory for a long time!.

  3. Tom

    I can’t get this to work in 7.10. Has the command changed?

  4. xMoDx

    not working on Ubuntu Hardy

  5. xMoDx

    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’

  6. Joel

    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.

  7. sam

    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.

  8. Liquid

    LoL, he was type it 6 days before you…..

  9. Priya

    sudo rm -rf ‘/home/username/.local/share/Trash’ on Ubuntu 8.04
    thanks alot…

  10. Bodsda

    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

  11. Richard

    Hey, I found an easy, easy way…

    Simply right-click on the trash icon and and left-click empty trash.

    That’s it!

Get Free Articles in Your Inbox!

Join 134,000 newsletter readers

Email:

Go check your email!