01-01-2002
1,626,
15
Join Date: Jul 2001
Last Activity: 16 June 2011, 4:50 PM EDT
Location: Portland, OR, USA
Posts: 1,626
Thanks Given: 2
Thanked 15 Times in 13 Posts
Interestingly, you can use this to your advantage... but more on that later. First off, try:
cd /his/directory
rm ./-You-idiot
Now, how it can help you:
cd $HOME
echo "Don't rm -r this directory" > ./-i
chmod 000 ./-i
now, if you execute "rm -r *" in that directory, the shell will substitute everything (in alphabetical order) in place of the *, so it'll interpret -i as the "interactive" flag... a little bit of safety.
TEST THIS IN A SAFE DIRECTORY FIRST! DON'T TRY THIS IN YOUR HOME DIRECTORY, JUST IN CASE!