From: Gregory Owen (gowen@apex.cs.tufts.edu)
Date: 08/08/93


From: gowen@apex.cs.tufts.edu (Gregory Owen)
Subject: Re: [Q] How to delete file with invalid name?
Date: Sun, 8 Aug 1993 17:57:06 GMT


jgeorge@whiffer.mese.com (Joe George) writes:
> filename, and I now have a file called "-u -v" in /usr/lib/uucp. Yes,
> dash-u-space-dash-v. I can't delete it. I can, however, EDIT it,
> with joe by enclosing the filename in single quotes, so it's now a 0
> length file, but rm chokes on trying to delete it. rm the -u -v as
> parameters and I get an error that -u is invalid.

        Luckily for you, the 7-part FAQ just got posted on
comp.unix.shells, and it has 2 questions devoted to this. You can
find it on comp.unix.shells, comp.answers, and it will be archived on
rtfm.mit.edu.
        But that's not the answer you wanted, is it? Of course not.
You can try "rm ./-f\ -u", where './' is the current directory (put
there to keep rm from reading -f as an argument and where the "\ "
escapes the space so as to keep it part of the filename. There are
several other ways, as well (in that FAQ, hint hint).
        (I'm not trying to single you out for the FAQ thing. But
everyone should read all the Unix faqs they can get their hands on at
least once if they run Linux, because it helps immensely for things
like this).

  Greg Owen { gowen@forte.cs.tufts.edu, gowen@xis.xerox.com }
 1.01 GCS/GO d++ p+ c++ l++ u++ e+ -m+ s++/- n- h !(f)? g+ -w+ t+ r-- y?
"These fragments I have shored against my ruins/Why then Ile fit you.
 Hieronymo's mad againe./Datta. Dayadhvam. Damyata."