Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question

3 Answers 3

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

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

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.