From owner-freebsd-questions Sat May 12 15:19:36 2001 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-65-26-235-186.mmcable.com [65.26.235.186]) by hub.freebsd.org (Postfix) with SMTP id D4E0337B424 for ; Sat, 12 May 2001 15:19:31 -0700 (PDT) (envelope-from mwm@mired.org) Received: (qmail 4646 invoked by uid 100); 12 May 2001 22:19:30 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15101.46834.852098.728904@guru.mired.org> Date: Sat, 12 May 2001 17:19:30 -0500 To: User Ipt Ian Patrick Thomas Cc: questions@freebsd.org Subject: Re: How can I delete this file In-Reply-To: <90647916@toto.iv> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG User Ipt Ian Patrick Thomas types: > I forgot to add the z flag when I extracted from a tarred file and in > return got this file... > > ?????c???-G???IR??????????I]????[?7jY?#??8?5??t???r???x?????LWL?]|?n?3b?????V??1 > S???? > How on earth can I delete this? One of the oldest questions in the (unix) book. It was in the FAQ in the 80s; I'm surprised it's not in the FreeBSD FAQ. Couple of approaches. If there aren't many other files in the directory with it, you can try doing "rm -i *" in that directory, and just answer "n" to all the other files. Another is to create an empty directory as a sibling of the one the file is in, move everything else into the new directory, rm -rf the old one, and rename the new one to the old name. The approach that works if you've got lots of files you want to keep with no naming regularity is to construct a regular expression that only the file matches, check it with echo, then use rm on it: % echo *IR*LWL*3b* % rm !$ Oh yeah - if rm tries to interpret the file name as an option, you can just use '--' after any options to tell rm that there *are* no more options. http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message