Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Dec 2000 17:03:22 -0500 (EST)
From:      Joe Oliveiro <joe@advancewebhosting.com>
To:        Mike Meyer <mwm@mired.org>
Cc:        Larry Rosenman <ler@lerctr.org>, Daniel.Bye@uk.uu.net, questions@FreeBSD.ORG
Subject:   Re: Pesky file
Message-ID:  <Pine.BSF.4.21.0012011703120.17623-100000@joe.pythonvideo.com>
In-Reply-To: <14888.4617.148599.530943@guru.mired.org>

next in thread | previous in thread | raw e-mail | index | archive | help
rm -rf "-help" 

will remove the file

FreeBSD - The BEST upgrade you can do to NT!

On Fri, 1 Dec 2000, Mike Meyer wrote:

> Larry Rosenman <ler@lerctr.org> types:
> > * Daniel Bye <Daniel.Bye@uk.uu.net> [001201 05:21]:
> > > Hi all,
> > > 
> > > Here's a question for a Friday morning...  Somehow, I have ended up with a 
> > > file named -help in my home directory.  How can I get rid of it?  It is 0
> > > bytes, 
> > > and if I try to rm, mv, unlink it etc, the shell interprets the file name as
> > > an 
> > > argument to the program and spews forth errors.  Backslash escaping it 
> > > doesn't work, and neither does quoting it.
> > rm -- -help
> > 
> > or rm -i ?help
> 
> That won't work any more than "rm *help" would. The problem with both
> of them is that the shell expands the metacharacters, so that rm sees
> the "-" first, so thinks it's an argument.
> 
> Just FWIW, if you happen to be on a system that doesn't recognize the
> "--" convention (or need to run a command that doesn't), you can
> always do "rm ./-help".
> 
> Trivia question: what two bytes can you *not* put in a Unix filename?
> 
> 	<mike
> --
> Mike Meyer <mwm@mired.org>			http://www.mired.org/home/mwm/
> Independent WWW/Unix/FreeBSD consultant,	email for more information.
> 
> 
> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0012011703120.17623-100000>