A few days ago, there was a new entry on commandlinefu.com about how to annoy your colleague sysadmins:
cd / && touch ./\-rf\ \*
To be honest, I think this is only for noobs of shell users. You can use file manager to remove it without any issue if you have the permission, they should be able to handle those files without problems.
That filename is basically for tricking you into doing:
rm -rf /
and this won’t work for many years without specifying --no-preserve-root option, it’s just for scaring newbies, who don’t exactly know how to use shell without breaking something. Funny thing is as a normal user, you can only break things at your home or settings. (Maybe sudo that filename?)
You can read the comments in that entry, I commented with a solution and another guy also provided a more common one, which somehow I forgot:
rm -- -<TAB>
rm ./-fr\ *
It is really nothing to a system admin, only you may get a real annoying payback instead of this kindergarten-level tickle (the filename), and you don’t even see it coming.
What about `unlink`?
ReplyDeleteThat's another viable option, simply replacing `rm` with `unlink` does the job, too.
ReplyDeleteYeah, as far as I know, since `unlink` didn't take any options, so no "tricks" needed at all.
ReplyDelete