Deleting a file where the first character in name is a '-'

Bob McClure Jr robertmcclure at earthlink.net
Wed Sep 8 22:01:37 UTC 2004


On Wed, Sep 08, 2004 at 02:33:05PM -0700, Mark Knecht wrote:
> Hi all,
>    Since Rick suggested I'd been absent too long ;-) here's one for the 
> team. How do I delete this file? I'm stumped, but that's easy to do.
> 
> flash Images $ ls -la
> total 388776
> -rw-r--r--   1 mark users   6920582 Apr 28 15:34 
> -weed-Onion_Jack-Fake_Moon_Landings.wma
> drwxr-xr-x   2 mark users      4096 Sep  8 14:19 .
> drwx------  70 mark users      4096 Sep  8 14:12 ..
> flash Images $
> 
> I tried quoting it, and back/forward slashing it, but I'm not able to 
> get rid of it.
> 
> thanks,
> Mark

In most if not all *nix apps, using "--" before the argument you want
not interpreded as an option will work, to wit:

  rm -- -weed*

Cheers,
-- 
Bob McClure, Jr.             Bobcat Open Systems, Inc.
robertmcclure at earthlink.net  http://www.bobcatos.com
Grace happens.





More information about the Redhat-install-list mailing list