*BSD News Article 42923


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.cs.su.oz.au!metro!wabbit.cc.uow.edu.au!news.tansu.com.au!picasso.cssc-syd.tansu.com.au!newshost!chrisb
From: chrisb@stork.cssc-syd.tansu.com.au (Chris Bitmead)
Newsgroups: comp.unix.bsd
Subject: Re: Removing a file with a leading "-" in the name
Date: 27 Feb 95 13:56:51
Organization: Telecom Australia
Lines: 17
Message-ID: <CHRISB.95Feb27135651@stork.cssc-syd.tansu.com.au>
References: <1995Feb20.023938.20960@rai.juice.or.jp> <3ii3lt$m9b@crl3.crl.com>
	<3iijvt$f2r@owl.und.ac.za>
NNTP-Posting-Host: stork.cssc-syd.tansu.com.au
In-reply-to: harverso@beastie.cs.und.ac.za's message of 23 Feb 1995 18:26:05 GMT

In article <3iijvt$f2r@owl.und.ac.za> harverso@beastie.cs.und.ac.za (Tony Harverson ) writes:

>An interesting version of this question I got out of a set of notes on a SCO
>course was this....
>
>use ls -i to find the inum of the file.
>find /path/ -inum <number> -exec rm {} \; 
>It seems to work on most - anyone know of a case when it won't ?

This will work, but it's a heck of a lot harder to type than "rm ./-foo".

The "find" method might be good if the filename has other weird control
characters in it.
--

Chris Bitmead
chrisb@ind.tansu.com.au