From owner-freebsd-questions Mon Jul 19 16:52:44 1999 Delivered-To: freebsd-questions@freebsd.org Received: from unix1.digital-web.net (unix1.digital-web.net [216.65.27.2]) by hub.freebsd.org (Postfix) with ESMTP id 302741515C for ; Mon, 19 Jul 1999 16:52:39 -0700 (PDT) (envelope-from joseph@randomnetworks.com) Received: from localhost (jmscott@localhost) by unix1.digital-web.net (8.9.3/8.9.3) with ESMTP id TAA04833; Mon, 19 Jul 1999 19:47:37 -0400 (EDT) Date: Mon, 19 Jul 1999 19:47:36 -0400 (EDT) From: Joseph Scott X-Sender: jmscott@unix1.digital-web.net Reply-To: Joseph Scott To: Chris Cc: freebsd-questions@FreeBSD.ORG Subject: Re: whoops, can't remove file :\ In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Take a look at the man page for rm(1). You'll find this treasure right under the NOTE section : NOTE The rm command uses getopt(3) to parse its arguments, which allows it to accept the `--' option which will cause it to stop processing flag options at that point. This will allow the removal of file names that begin with a dash (`-'). For example: rm -- -filename The same behavior can be obtained by using an absolute or relative path reference. For example: rm /home/user/-filename rm ./-filename Took me awhile to figure this out the first time I did it :-) Joseph Scott joseph@randomnetworks.com On Mon, 19 Jul 1999, Chris wrote: > -----BEGIN PGP SIGNED MESSAGE----- > > Dumb 'ol me accidently created a file with a leading - and now I can't get > rid of it because rm tells me "invalid option". > > ex- > > chrismar@stupid /home > rm -rf -h > rm: invalid option -- h > Try `rm --help' for more information. > > Any ideas? > > Chris > > -----BEGIN PGP SIGNATURE----- > Version: 2.6.2 > > iQB1AwUBN5O3y/bh8rV07zbRAQEBbgMAk8PPX3C8qPE8jNBTapX4EAnGHynDcH9J > sYxgaphxQULEHPzR7zi/DJKdkkh6MAb25jGPSPqEpKKgCOYYsyXfLRxzW4G16ukQ > NUdPdKNDPsRCw32Gmh5oBaRilIG51BZG > =UfYk > -----END PGP SIGNATURE----- > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message