[NTLUG:Discuss] remove file

Patrick R. Michaud pmichaud at pobox.com
Wed Apr 20 12:22:13 CDT 2005


On Wed, Apr 20, 2005 at 11:28:35AM -0500, David Simmons wrote:
> On Wed, 2005-04-20 at 07:46 -0700, Steve Baker wrote:
> >      rm -- -whatever
> > ...will remove a file called '-whatever' without saying:
> 
> Wow!  I've lived with a '-directory' name for awhile...Thanks for the
> tip - worked like a charm!!  (and now I can say I've learn something
> everyday! - at least for today)

Another way of doing this is to preface '-whatever' with a directory,
thus:

   rm ./-whatever

or

   cd ..
   rm somedir/-whatever

or

   mkdir dummy
   cd dummy
   rm ../-whatever
   cd ..
   rmdir dummy

Pm




More information about the Discuss mailing list