Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

I've tried executing sudo rm * and it does not remove everything. (I probably have lots of objects in there which I don't need.)

I'm not asking whether it is OK to remove everything in /tmp, I'm asking how to do it. Is there a shell script that can do it?

share|improve this question

You can use

rm -rf *

-r for recursive (also subdirectories) and -f for force (also write-protected files). But be careful in using this.

share|improve this answer

From man rm:

By default, rm does not remove directories. Use the --recursive (-r or -R) option to remove each listed directory, too, along with all of its contents.

So try this:

sudo rm -r *
share|improve this answer

Your Answer


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.