What does "rm -rf" on it's own do?

Red Squirrel

No Lifer
May 24, 2003
70,261
13,626
126
www.anyf.ca
I accidentally did "rm -rf & /folder &" when what I really want to do "rm -rf /folder &"

So naturally, "rm -rf" got executed and it just returned to a prompt right away. What happened, what did it delete, did it delete anything at all? Was a stupid mistake on my part, I always double check the path when running that command.
 

Aluvus

Platinum Member
Apr 27, 2006
2,913
1
0
On my Ubuntu box, running rm -rf without the (mandatory) file parameter just returns without doing anything.
 

Red Squirrel

No Lifer
May 24, 2003
70,261
13,626
126
www.anyf.ca
That's what it did for me as well. I was just scared that maybe it did do something. Like maybe it defaults to a certain folder. I can't find anything missing so far though, so my hunch is that it did not touch anything.
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
That's what it did for me as well. I was just scared that maybe it did do something. Like maybe it defaults to a certain folder. I can't find anything missing so far though, so my hunch is that it did not touch anything.

That would be the most idiotic design decision ever. If it did default to something, the man page would certainly say so.
 

Blades

Senior member
Oct 9, 1999
856
0
0
Could just be a side effect of -f..
-f, --force ignore nonexistent files, never prompt

It just did as it said it would.. :)