Subscribe to 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!

| More
This article was originally written on 12/13/06 Tagged with: Ubuntu, Ubuntu Tips & Tweaks

Daily Email Updates

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


Name:
Email:

Comments (10)

  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


Leave a Comment




Leave your friendly comment here.

If you have a computer help question, click here to leave it on the forums instead.

Note: Your comment may not show up immediately on the site.

Our Friends
Getting Started


About How-To Geek
What Is That Process?
svchost.exe
jusched.exe
dwm.exe
ctfmon.exe
wmpnetwk.exe
wmpnscfg.exe
rundll32.exe
wfcrun32.exe
Ipoint.exe
Itype.exe
Wfica32.exe
Mobsync.exe
conhost.exe
Dpupdchk.exe Adobe_Updater.exe

Copyright © 2006-2009 HowToGeek.com. All Rights Reserved.