Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the shell command to empty the garbage bin under Linux?

share|improve this question

Except for the ~/.local/share/Trash trash files for other file systems may be stored in <mount-point>/.Trash-$(id -u) directories. If your're running ubuntu there is a helper package to clean all locations

sudo aptitude install trash-cli

To clean the trash in all locations just run:

empty-trash

It should work with any linux desktop environment compliant with FreeDesktop.org Trash Specification. On newer versions, the command may be:

trash-empty
share|improve this answer
    
Good point. More info here: manpages.ubuntu.com/manpages/lucid/man1/empty-trash.1.html – Linker3000 Oct 15 '10 at 9:50
rm -rf ~/.local/share/Trash/files

If not under .local/share, it may be under ~/.Trash

share|improve this answer
    
Thanks for your answer, but in .local/share/ I have just "applications" and "mime", no Trash to be found :(. – Rob Oct 15 '10 at 9:35
    
OK - have a look for /home/YOURUSERNAME/.Trash – Linker3000 Oct 15 '10 at 9:39
    
Many thanks, that was it ;) – Rob Oct 15 '10 at 10:05

In case you would like to empty the trash of the currently logged in user:

rm -rf ~/.local/share/Trash/files/*
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .