Home > Linux > How to forcefully empty the Trash : Ubuntu (5.10 / 6.06.1 / 6.10)

How to forcefully empty the Trash : Ubuntu (5.10 / 6.06.1 / 6.10)

Have you ever run into the situation where something wouldn’t delete from your Trash folder? I’ve run into it a few times and I’m not even sure why it happens. For those times when you need to forcefully empty the Trash you can use the following command:

rm -rf $HOME/.Trash or sudo rm -rf $HOME/.Trash

Note: you should be careful when using the -f (forceful) option with remove. It will just straight-out remove something with no verification. It could be dangerous if it ever fell into the wrong hands ;) .

Yes, this is a quick tutorial for the day. Tune in tomorrow for a little talk about Viruses.

Categories: Linux Tags:
  1. December 22nd, 2006 at 08:54 | #1

    Before you do it next time, check the permissions and ownership of the things in your trash. My guess is that they don’t belong to you. chown + chmod them and see if you can empty the trash without using an “rm -rf”. Anyway, that usually helps me.

  2. December 23rd, 2006 at 06:25 | #2

    I’d recommend not to remove the trash can itself. Use
    rm -rf $HOME/.Trash/*
    instead when emptying the trash can this way.

  3. December 23rd, 2006 at 09:08 | #3

    I wonder if this happens when you delete a read-only directory.

    I’m certain that it is harmless to remove the ~/.Trash directory itself. I’m sure GNOME will re-create it on demand.

    By the way, not everything in your trash can is stored in ~/.Trash/. If you’ve deleted something on other partitions, the trash will be stored in the root of that particular partition, under .Trash-yourusername.

    • FlowerPowerDj
      May 29th, 2009 at 07:11 | #4

      you really helped me!!!!!
      … other partitions….
      ThanksThanksThanksThanksThanksThanks
      Fiorenzo

  4. December 23rd, 2006 at 10:48 | #5

    My guess is that, yes, its caused by read-only files. It hasn’t happened often but I’ve had to forcefully remove items even after checking ownership & permissions.

    thanks for the comments. Alexander’s method is probably safest in my opinion.

  5. June 20th, 2008 at 06:04 | #6

    My Trash directory is somewhere else. But generally thank you! :)

    This is my path:
    /home/zager/.local/share/Trash/files

    Where “zager” is my login name.

  6. ibeapunker
    July 4th, 2008 at 19:17 | #7

    This worked!

    sudo rm -rf /home/username/.local/share/Trash/files

  7. Jags_FL
    November 1st, 2008 at 06:25 | #8

    Thanks a lot, Vitezslav Valka

    from the detailed path:

    /home/username/.local/share/Trash/files

    in your post I was able to delete files & folder from Trash in Ubuntu Intrepid 8.10

    • Jon
      October 3rd, 2009 at 00:56 | #9

      That FINALLY worked, thanks tons! [even though that post is almost a year old, haha]

  1. No trackbacks yet.