> Hello,
> Can somebody help me out there.. Well here's my problem.. Out
> of stupidity I made some files with the filename of
> -c
> and the other
> -z
> (those are the name of the files)..
> rm refuses to remove them.... I do
> rm -c (It comes out with an invalid switch??)
> if I do rm * (It comes out with -c invalid option)..
> I tried almost everything, how do I delete this..
> Thanks for any reply..
> George Daswani
Look into the unix FAQ and you find:
-------------------------------------- snip ----------------------
Subject: How do I remove a file whose name begins with a "-" ?
Date: Thu Mar 18 17:16:55 EST 1993
2.1) How do I remove a file whose name begins with a "-" ?
Figure out some way to name the file so that it doesn't begin
with a dash. The simplest answer is to use
rm ./-filename
(assuming "-filename" is in the current directory, of course.)
This method of avoiding the interpretation of the "-" works with
other commands too.
Many commands, particularly those that have been written to use
the "getopt(3)" argument parsing routine, accept a "--" argument
which means "this is the last option, anything after this is not
an option", so your version of rm might handle "rm -- -filename".
Some versions of rm that don't use getopt() treat a single "-"
in the same way, so you can also try "rm - -filename".
-------------------------------------- snap ----------------------
Andreas
--
------------------------------------------------------------------------
Andreas Dunker 2B || ! 2B