From owner-freebsd-questions@FreeBSD.ORG Fri Oct 20 17:11:20 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 77DF216A417 for ; Fri, 20 Oct 2006 17:11:20 +0000 (UTC) (envelope-from dave.list@pixelhammer.com) Received: from ecluster5.tls.net (ecluster5.tls.net [65.196.224.135]) by mx1.FreeBSD.org (Postfix) with SMTP id 11E0643D7E for ; Fri, 20 Oct 2006 17:11:17 +0000 (GMT) (envelope-from dave.list@pixelhammer.com) Received: (qmail 5972 invoked by uid 89); 20 Oct 2006 17:10:20 -0000 Received: from 64-184-9-181.bb.hrtc.net (HELO ?192.168.0.103?) (ldg%tls.net@64.184.9.181) by auth-ecluster5.tls.net with SMTP; 20 Oct 2006 17:10:20 -0000 Message-ID: <45390333.4020007@pixelhammer.com> Date: Fri, 20 Oct 2006 13:11:15 -0400 From: DAve User-Agent: Thunderbird 1.5.0.4 (Windows/20060516) MIME-Version: 1.0 To: freeBSD References: <20061020162119.49001.qmail@web25221.mail.ukl.yahoo.com> In-Reply-To: <20061020162119.49001.qmail@web25221.mail.ukl.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 17:11:20 -0000 Efren Bravo wrote: > Hi, > > 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? You have probably found that anything you try errors because the shell thinks -e is a switch. The easiest way is to find the files inode number and delete the file using that. director# ls -i 107008 .bash_history 107760 .login 107759 .mail_aliases 107764 .profile 107765 .shrc 107758 .cshrc 107761 .login_conf 107762 .mailrc 107763 .rhosts then use find to remove the file. director# find . -inum 107763 -exec rm -i {} \; remove ./.rhosts? y This works for all manner of funky file names. I had done that many times before, generally from not reading man pages and passing switches to programs that didn't expect it, or by piping commands incorrectly. DAve -- Three years now I've asked Google why they don't have a logo change for Memorial Day. Why do they choose to do logos for other non-international holidays, but nothing for Veterans? Maybe they forgot who made that choice possible.