*BSD News Article 24305


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!skates.gsfc.nasa.gov!hq.hq.af.mil!scratchy.hq.af.mil!lpeters
From: lpeters@scratchy.hq.af.mil (Leslie D. Peters)
Newsgroups: comp.os.386bsd.questions
Subject: Re: How do you rm a strange file?
Date: 22 Nov 1993 13:32:57 GMT
Organization: Defense Information Service Agency
Lines: 40
Distribution: world
Message-ID: <2cqf29$f1f@hq.hq.af.mil>
References: <2ch6t2$ih5@netbsd08.dn.itg.telecom.com.au> <2cmstq$78e@netbsd08.dn.itg.telecom.com.au>
Reply-To: lpeters@scratchy.hq.af.mil
NNTP-Posting-Host: scratchy.hq.af.mil

In article <2cmstq$78e@netbsd08.dn.itg.telecom.com.au>, tdwyer@netbsd08.dn.itg.telecom.com.au (Terry Dwyer 619 491 5161) writes:
|> Terry Dwyer 619 491 5161 (tdwyer@netbsd08.dn.itg.telecom.com.au) wrote:
|> :  seem to have created a file that I can't delete in the middle of 
|> : a large directory structure:
|> 
|> : -rw-r--r--    1 tdwyer         58 Nov 19 08:54 -lg | less
|> 
|> : Any clues how to rm it?
|> 
|> (Following up to my own article - sorry)
|> 
|> Thanks to all the people who replied to my message, so far about 11 and 2
|> postings.  Because there seem to be so many different ways you can do this,
|> a short summary:
|> 
|> (1) rm - "-lg | less"						pass
|> (2) rm ?lg???less						fail
|> (3) rm -- "-lg | less"						Better than (1)
|> (4) rm this_sucks "-lg | less"					pass
|> (5) Get a tcsh or bash, then type: rm -<TAB>			fail
|> (5) mkdir tmp; mv [~-]* tmp/; rm *; mv tmp/* .; rmdir tmp	????
|> (6) rm -i *							fail
|> 
|> -- 
|>    _-_|\    Terry Dwyer 	  E-Mail: tdwyer@netbsd08.dn.itg.telecom.com.au
|>   /     \   System Administrator  Phone: +61 9 491 5161     Fax: +61 9 221 2631
|>   *_.^\_/   Telecom Australia     Telstra Corporation       MIME capable mailer
|>        v    Perth  WA                 ( I do not speak for Telstra or Telecom )

Here's another for your list, fron the annuls of "UNIX Power Tools":

ls -i; find . -inum <###> -exec rm {} \;

Works like a champ
-- 
|"...I have pores: humans have pores.  I have fingerprints: humans have  |
|fingerprints.  My chemical nutrients are like your blood.  If you prick |
|me, do I not........leak?"                                              |
| - Data to Capt Picard, Star Trek: The Next Generation "The Naked Now"  |
| Les Peters (lpeters@scratchy.hq.af.mil) Proud to run NetBSD 0.9!       |