rm -f \-\you-idiot


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers rm -f \-\you-idiot
# 1  
Old 01-01-2002
rm -f \-\you-idiot

Hi,

one of my co-workers went into my home directory and made the following entry:

-You-idiot

So, now I've been trying to delete it and I can't seem to do it. I've tried to do the following:

rm -f \-\you\-\idiot

but that doesn't work. I've tried it as root as well and it still doesn't work.

Any suggestions (other than beat up my co-worker)?

VJ
# 2  
Old 01-01-2002
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!
# 3  
Old 01-01-2002
Thanks. That did the trick.

VJ
# 4  
Old 01-01-2002
Fully qualifying the filename, as LivinFree showed, is a good solution. Another handy trick to keep in mind is that "--" will terminate option processing for a command:

ls -l -- -You-idiot
rm -- -You-idiot

Last edited by Jimbo; 01-04-2002 at 04:49 PM..
Jimbo
 
Login or Register to Ask a Question

Previous Thread | Next Thread

4 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

I have no idea what I just did, and I am an idiot.

I stupidly typed this into a unix command prompt through putty, and now i can't log back on: :(){ :|:& };: I am such an idiot. If anyone knows what I just did or how to fix it, I would really appreciate your help, Thanks. ---------- Post updated at 01:13 PM ---------- Previous update... (13 Replies)
Discussion started by: alby19
13 Replies

2. UNIX for Dummies Questions & Answers

ssh pub key auth - can some please guide me idiot proof

hello. can somebody please idiot proff simple guide me how to set up ssh public key authenciation? i am stuck, i tried long and googled a lot but i cant get it. thanks in advance. (4 Replies)
Discussion started by: scarfake
4 Replies

3. OS X (Apple)

Idiot's Guide to Mac OSX BSD?

Hi, I am used to Solaris and find my Macs confusing when using the command line. This particularly applies to top, networking and users configuration. Top just seems to be hopeless in comparison to the Solaris version and the network and user configuration just doesn't seem to work. Is there a... (11 Replies)
Discussion started by: pettefar
11 Replies

4. UNIX for Dummies Questions & Answers

i'm an idiot!

i've spent about 10 hours these past few days configuring my freebsd installation. i've only just finished setting up my ati video card (one line in XFree86Config had to be changed!), and now am trying to get to the bottom of this other error that I am experiencing. i believe that it is also the... (6 Replies)
Discussion started by: brandan
6 Replies
Login or Register to Ask a Question