Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'A warning on a new destructive 'trojan horse'' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A warning on a new destructive 'trojan horse'
Authored by: renderit on May 12, '04 01:43:43PM

By the way, -r arguement DOES NOT mean remove the top level directory, it means RECURSIVE REMOVE which will remove all directories below the start point, i.e.: to rm -r * would blow away the current directory, files and ALL BELOW IT AS WELL. Subtle but important point.....



[ Reply to This | # ]
A warning on a new destructive 'trojan horse'
Authored by: robg on May 12, '04 01:51:45PM

Sorry, I meant to type it that way, but re-reading it, it's not clear that's what I was saying :). So I changed it a bit to hopefully reflect the proper definition.

-rob.



[ Reply to This | # ]
A warning on a new destructive 'trojan horse'
Authored by: kf6auf on May 13, '04 04:50:23AM

I have been looking for clarification about rm -rf. Are my following assumptions correct?

rm -rf ~/
removes your home directory and everything in it

rm -rf /
obviously deletes everything it can

rm -rf ~/*
removes everything in your home directory and /home (or /Users) and /
this is the one I would like clarification on, and I don't want to try it
(In other words, is this effectively the same as "rm -rf /" in most cases?)

Thanks.



[ Reply to This | # ]
A warning on a new destructive 'trojan horse'
Authored by: frankc on May 13, '04 08:44:52AM

no, rm -rf ~/* is an exact synonym for rm -rf ~. The shell will interpret the ~/* and expand (glob) it in arguments for each entry in your home directory, so the actual command would be rm -rf ~/Library ~/Projects ....



[ Reply to This | # ]
A warning on a new destructive 'trojan horse'
Authored by: ReznorB5 on May 14, '04 06:32:11AM

Actually, rm -rf ~ and rm -rf ~/* are different because the former deletes the user directory itself and all subdirectories and files, whereas latter refers to the contents of the user directory, excluding any files that begin with a dot. Also, -R and -r are equivalent flags, and when you use -f, it implies -d automatically, so only -f is needed.

Also, in order so see what files it will get when you specify "~" slightly differently, try these commands and compare. This will list the contents of your user directory:
ls -Ra ~
ls -Ra ~/
ls -Ra ~/*



[ Reply to This | # ]
A warning on a new destructive 'trojan horse'
Authored by: davidbodonnell on May 13, '04 03:48:23PM
Drop to the Terminal and type
man rm
Or, if you are not at a Mac OS X machine, go to: http://www.hmug.org/man/1/rm.html. If I were to try this ‘exploit,' I'd use "rm -rfd ~".

[ Reply to This | # ]