[comp.unix.questions] Removing Erroneous Directory Entries

aponty@gpu.utcs.utoronto.ca (Adele Ponty) (05/09/91)

One of the users on our system somehow managed to create an
entry in our user_data directory which now appears at the
top of the directory listing as,  -k@   .  A long listing 
reveals it to be some sort of link entry they tried to create;
l--------- -k@   ...    ...  -k@ -> df
Can someone tell me how to get rid of it?  Can I prevent this
from happening again?  Thanks in advance.

-- 
                                                 ==== ==M= 
 INTERNET:  aponty@gpu.utcs.utoronto.ca          ==== ==i=
     UUCP:  wheaties@intacc.uucp         (bbs)   ==== ==n=
            aponty@agora.rain.com  (alternate)   =======g=

urban@cbnewsl.att.com (john.urban) (05/09/91)

In article <1991May9.051239.15919@gpu.utcs.utoronto.ca> aponty@gpu.utcs.utoronto.ca (Adele Ponty) writes:
>One of the users on our system somehow managed to create an
>entry in our user_data directory which now appears at the
>top of the directory listing as,  -k@   .  A long listing 
>reveals it to be some sort of link entry they tried to create;
>l--------- -k@   ...    ...  -k@ -> df
>Can someone tell me how to get rid of it?  Can I prevent this
>from happening again?  Thanks in advance.
>

See the FAQ (Frequently Asked Questions) #1 and 2.

This was probably create via:
	# ln -s df '-k\@'		<- Note \ is to escape the @ symbol.
	# ls -l
	lrwxrwxrwx  1 root other   2 May 8 09:22 -k@ -> df
	drwxrwxrwx  2 sys  sys   512 May 8 09:22 .
	drwxrwxr-x 24 root sys   512 May 7 15:38 ..

To remove it type in:
	# rm - -k\@

The first - notifies rm that all the arguements are done so therefore the -k isn't
an argument to rm but a file name.

You could have also typed in:
	# rm ./-k\@


Sincerely,

John Ben Urban
att!attunix!jbu