From owner-freebsd-questions@FreeBSD.ORG Fri Oct 20 16:46:26 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 35DAF16A412 for ; Fri, 20 Oct 2006 16:46:26 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id CD71443D55 for ; Fri, 20 Oct 2006 16:46:25 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.6/8.13.8) id k9KGkMwf003671; Fri, 20 Oct 2006 11:46:22 -0500 (CDT) (envelope-from dan) Date: Fri, 20 Oct 2006 11:46:21 -0500 From: Dan Nelson To: Bill Moran Message-ID: <20061020164621.GA2332@dan.emsphone.com> References: <20061020162119.49001.qmail@web25221.mail.ukl.yahoo.com> <20061020123038.2dc602f3.wmoran@collaborativefusion.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20061020123038.2dc602f3.wmoran@collaborativefusion.com> X-OS: FreeBSD 6.2-PRERELEASE X-message-flag: Outlook Error User-Agent: Mutt/1.5.13 (2006-08-11) Cc: freeBSD , Efren Bravo Subject: Re: rm command problem X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Oct 2006 16:46:26 -0000 In the last episode (Oct 20), Bill Moran said: > In response to Efren Bravo : > > Accidentally I've created a file called -exclude and now I cann't > > delete it. > > > > I tried with: > > > > rm -exclude and rm *exclude but it returns this: > > > > rm: illegal option -- - > > usage: rm [-f | -i] [-dIPRrvW] file ... > > unlink file > > > > How can I delete it? > > rm \-exclude or rm '-exclude' Actually neither of those will work :) If '-' was a wildcard character interpreted by the shell it would have, but rm is the problem here, not the shell. You need to either tell rm to ignore leading dashes as options (using the -- option): rm -- -exclude , or move the dash away from the beginning of the path: rm ./-exclude -- Dan Nelson dnelson@allantgroup.com