From owner-freebsd-questions Wed Apr 22 07:59:00 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA26993 for freebsd-questions-outgoing; Wed, 22 Apr 1998 07:59:00 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from back1.hiper.net (back1.hiper.net [207.137.172.6]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA26943 for ; Wed, 22 Apr 1998 14:58:51 GMT (envelope-from randyk@ccsales.com) Received: from ntrkcasa (pool31.hiper.net [207.137.172.31]) by back1.hiper.net (8.8.7/8.8.7) with SMTP id HAA13605; Wed, 22 Apr 1998 07:59:55 -0700 (PDT) (envelope-from randyk@ccsales.com) Message-Id: <3.0.5.32.19980422075707.03482210@ccsales.com> X-Sender: randyk@ccsales.com X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.5 (32) Date: Wed, 22 Apr 1998 07:57:07 -0700 To: Randall Hopper , Andrew , freebsd-questions@FreeBSD.ORG From: "Randy A. Katz" Subject: Re: How To Delete Certain Files In-Reply-To: <19980422105204.A24838@ct.picker.com> References: <008a01bd53ac$8dd26c60$e34a05cb@alpine.iaccess> <008a01bd53ac$8dd26c60$e34a05cb@alpine.iaccess> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I wasn't going to say this publicly on the list but here it goes: This is the first answer that will work. I got plenty of answers that would result in the toasting of the directory (no, I didn't toast it, I'm not that glib, I tested on a make believe directory first). I think it is very important in computing that when you answer a question you either qualify that you've tested it (or not). Thanx for all your efforts, Randy Katz At 10:52 AM 4/22/98 -0400, Randall Hopper wrote: >Andrew: > |Randy Katz : > |>Hello, > |> > |>I have files that are named: > |> > |>-p > |>--exclude > |> > |>How would I go about removing them? > | > |try this > | > |rm -rf "--exclude" > |rm -rf "-p" > > >I don't think this will work. What you want is: > > rm -- --exclude -p > >"--" terminates argument processing so that "rm" doesn't think anything >else after that beginning with a "-" is an option. This should work with >most system commands. > >Alternatively, change the filename so that it doesn't start with a -. E.g.: > > rm ./--exclude ./-p > >Another option. Put a filename that "doesn't" begin with a dash (possibly) >before the ones that do. E.g.: > > rm abcdef --exclude -p > >Randall > > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message