Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!apple!oliveb!mipos3!omepd!merlyn From: merlyn@intelob.intel.com (Randal L. Schwartz @ Stonehenge) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: deleting ugly file names (was Re: Ugly file name) Summary: the definitive answer attached Message-ID: <4438@omepd.UUCP> Date: 16 May 89 14:16:17 GMT References: <128@tdl.UUCP> <7170@bsu-cs.bsu.edu> <2252@Portia.Stanford.EDU> Sender: news@omepd.UUCP Reply-To: merlyn@intelob.intel.com (Randal L. Schwartz @ Stonehenge) Followup-To: comp.unix.questions Distribution: na Organization: Stonehenge; netaccess via BiiN, Hillsboro, Oregon, USA Lines: 36 In-reply-to: joe@hanauma (Joe Dellinger) Xref: utzoo comp.unix.questions:13664 comp.unix.wizards:16173 In article <2252@Portia.Stanford.EDU>, joe@hanauma (Joe Dellinger) writes: | Even "rm -i *" used to be dangerous. There is the famous case where | somebody accidentally created a file name "-f", and decided to remove | it by doing "rm -i *". The csh dutifully expanded this to | "rm -i -f [files...]", and at that time "-f" overrode "-i" in rm. | Result: everything in the directory deleted EXCEPT the file "-f"! | Now -i overrides -f in rm, at least, but rm still interprets files | beginning with a "-" as options instead of file names, even when expanded | by the csh. I guess poor rm has no way of knowing what you typed and | what the csh expanded. Hasn't this one gotten into the folklore properly yet? The *proper* way to delete really nasty filenames is: (1) find yourself a *dumb* terminal (at least something that doesn't interpret control characters) (2) cd to the directory where the beasty lives (3) type "rm -ir ." CAREFULLY (4) type a bunch of "n"s, followed by The One True "y" CAREFULLY [the proper number of "n"s is left as an exercise to the reader] (5) pour yourself a cold one (in my case, Classic Coke[tm]) No shell interpreter's gonna get in *my* way. Works even on names that have hi-bits set! (Gurus know what I mean... if you don't know what that is, don't ask.) Just another UN*X Hacker, -- ***** PLEASE IGNORE THE ADDRESS IN THE HEADER ***** /=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095===\ { ...!uunet!agora.hf.intel.com!merlyn } \=Cute quote: "Welcome to Oregon... home of the California Raisins!"=/