From owner-freebsd-questions@FreeBSD.ORG Fri Apr 9 07:00:11 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 626C816A4CE for ; Fri, 9 Apr 2004 07:00:11 -0700 (PDT) Received: from smtp.med.miami.edu (smtp.med.miami.edu [129.171.64.6]) by mx1.FreeBSD.org (Postfix) with SMTP id BDB5243D31 for ; Fri, 9 Apr 2004 07:00:10 -0700 (PDT) (envelope-from dpiniell@newssun.med.miami.edu) Received: (qmail 17177 invoked from network); 9 Apr 2004 13:59:39 -0000 Received: from unknown (HELO newssun.med.miami.edu) (10.67.1.98) by smtp.med.miami.edu with SMTP; 9 Apr 2004 13:59:39 -0000 Message-ID: <4076ACF3.5030203@newssun.med.miami.edu> Date: Fri, 09 Apr 2004 10:02:27 -0400 From: David Piniella Organization: University of Miami User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5b) Gecko/20030901 Thunderbird/0.2 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Erik Trulsson , freebsd-questions@freebsd.org References: <20040409114035.40752.qmail@web40604.mail.yahoo.com> <20040409115034.GA57507@falcon.midgard.homeip.net> In-Reply-To: <20040409115034.GA57507@falcon.midgard.homeip.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: How can I remove this file ? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Apr 2004 14:00:11 -0000 Erik Trulsson wrote: >On Fri, Apr 09, 2004 at 12:40:35PM +0100, Supote Leelasupphakorn wrote: > > >>Hi lists >> >> How can I delete file named prefix with "-" ? >> >> > >If you had bothered to read the manpage for rm(1) you would already >know that since the following paragraph appears there: > > 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 > > > > > I've never run across that. % cd tmp % ls % touch - % ls - % rm - % ls % although if it was giving you trouble, I suppose you could do a rm ./\- -- David Piniella University of Miami