RSS

How to delete stuck folders and files from your trash in Ubuntu

Tue, Aug 5, 2008

Linux, Technology, Ubuntu, howto

Talk about it in our Forums

How to delete stuck folders and files from your trash in Ubuntu

Every now and again, I’ll find myself with some files sitting around in my trash that I can’t delete.  This can be particularily problematic when I’ve got several gigs worth of stale ISOs sitting there giving me an error like

Error removing file: Permission denied

I like computers but I’m not a big fan of when they talk back.  So here’s a quick and easy way to go into your system and nuke those files.

First, open up a terminal session (Applications-> Accessoris ->Terminal)

Now, type this:

cd /home/YOUR-USER-NAME/.local/share/Trash/files

Typing ‘ls’ at this point should reveal to you the folders and files you’re trying to delete.  Now on to the nuking.  If it’s just a few files, this will do:

sudo rm -f *

If it’s files, folders and files within folders, try this:

sudo rm -Rf *

No more stuck stuff in your trash.

Technorati Tags: , , , , , ,

Click the icon, share the link:
  • Digg
  • del.icio.us
  • MisterWong
  • Furl
  • Reddit
  • Technorati
  • BlinkList
  • feedmelinks
  • PopCurrent
  • Blogosphere News
  • Facebook
  • Fark
  • Mixx
  • Slashdot

This post was written by:

arsgeek - who has written 1975 posts on ArsGeek.


Contact the author

11 Comments For This Post

  1. Chad D Says:

    I will say thanks for this, as I had some folders in my trash I couldn’t empty because of permissions errors. I will also point out this isn’t Ubuntu specific as I run Arch Linux and it worked perfectly.

  2. budi Says:

    Hi there.
    The problem i run into is slightly different, there’s no file existed in the /home/YOUR-USER-NAME/.local/share/Trash/files directory. But when i have 1 or 2 files in the trash and try to empty trash, i got the real trash files emptied first, then the Trash Can talk back saying ” Cannot empty 1 of 20 files” whereas there’s not anymore trash file in it. any clue? thanks anyway!

  3. Ajay Says:

    really it did me a gr8 favr..thanx bud

    i’ve got a prob too..i,ve got a folder named MS-OFFICE2007..which seems to be lockd some how..plz tell me hw do i remove it..
    thanx a lot

  4. Dan Says:

    Thanks, worked on Ubuntu 8.04 64bit also using sudo rm -Rf *.

  5. aakostas Says:

    thanks, it’s very helpfull for me!!!

  6. MEK Says:

    Thanks, I couldn’t find where those files were hiding!

  7. Aan Says:

    Woi ………… Mod” bisa pake bahasa indo aja dak ….. hikz

    Help donks nih ……. trash -1000 bikin Ilfil !!!!!!!!!!!!!!! –”

  8. Paranoid Says:

    sudo rm -Rf *

    To beginners like me, that could spell trouble.
    Rather advise : sudo rm -rf /home/YOUR-USER-NAME/.local/share/Trash/files/*

  9. Paranoid Says:

    Yeah, I saw the “cd /home/YOUR-USER-NAME/.local/share/Trash/files”

    But I hate Reading TFM, so me just “rm -fr * .”

    Rather be explicit about the files you want to delete or whatever. And you must never ever do a “rm -fr *” without doing a “pwd” first.

    Oh, well that is just my 2 cents worth of opinion.

    Lanton

  10. tule Says:

    Thanks. Great tip.

  11. kanel Says:

    thanks alot with your tips.!

Leave a Reply