From owner-freebsd-questions Tue Nov 24 00:13:16 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id AAA21122 for freebsd-questions-outgoing; Tue, 24 Nov 1998 00:13:16 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from siafu.iconnect.co.ke (upagraha.iconnect.co.ke [209.198.248.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id AAA21116 for ; Tue, 24 Nov 1998 00:13:08 -0800 (PST) (envelope-from arb@anand.org) Received: from arb by siafu.iconnect.co.ke with local (Exim 2.05 #3) id 0ziDaa-0003BP-00; Tue, 24 Nov 1998 11:12:48 +0300 Message-ID: <19981124111248.B11637@iconnect.co.ke> Date: Tue, 24 Nov 1998 11:12:48 +0300 From: Anand Buddhdev To: "Leonard C." , questions@FreeBSD.ORG Subject: Re: How to delete files starting with "-"? References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93.2 In-Reply-To: ; from Leonard C. on Tue, Nov 24, 1998 at 12:12:25AM -0800 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, Nov 24, 1998 at 12:12:25AM -0800, Leonard C. wrote: > I accidentally created a file starting with a dash, and can't seem to > delete it. mv, cp, and rm all interpret the dash as an argument. > > If "-foo" is the name of the file, I've tried "-foo", '-foo', and \-foo, > but none of them work since these just affect the shell rather than the > actual parsing of the command itself. Any ideas? This is driving me > *absolutely* crazy! rm ./-foo The dot-slash causes the shell not to treat the hyphen specially. funnily though, rm '-foo' should also work, unless the permissions on the file do not allow you to delete it. If rm ./-foo does not work, then you should look at the permission on the file. That may be where your problem lies. -- Anand To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message