1

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?

0

2 Answers 2

1

You can use

rm -rf *

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

0

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 *

You must log in to answer this question.

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