From owner-freebsd-questions Wed Feb 12 12:59:27 2003 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3079837B401 for ; Wed, 12 Feb 2003 12:59:25 -0800 (PST) Received: from rutger.owt.com (rutger.owt.com [204.118.6.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7D7F143F93 for ; Wed, 12 Feb 2003 12:59:24 -0800 (PST) (envelope-from kstewart@owt.com) Received: from topaz-out (owt-207-41-94-233.owt.com [207.41.94.233]) by rutger.owt.com (8.9.3/8.9.3) with ESMTP id MAA25308; Wed, 12 Feb 2003 12:59:18 -0800 From: Kent Stewart To: Ruben de Groot Subject: Re: how to delete a file called ???? Date: Wed, 12 Feb 2003 12:59:18 -0800 User-Agent: KMail/1.5 Cc: parv , David Banning , questions@FreeBSD.ORG References: <20030212111232.A6759@skytrackercanada.com> <200302121145.33271.kstewart@owt.com> <20030212204251.GA74324@ei.bzerk.org> In-Reply-To: <20030212204251.GA74324@ei.bzerk.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200302121259.18010.kstewart@owt.com> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wednesday 12 February 2003 12:42 pm, Ruben de Groot wrote: > On Wed, Feb 12, 2003 at 11:45:33AM -0800, Kent Stewart typed: > > On Wednesday 12 February 2003 11:21 am, parv wrote: > > > in message <20030212111232.A6759@skytrackercanada.com>, > > > wrote David Banning thusly... > > > > > > > I have a file called ??????????????? > > > > > > ... > > > > > > > I can't seem to clean it away. > > > > > > > > rm ???????? > > > > rm '????????' > > > > rm "????????" > > > > > > > > all do not work. > > > > > > try something like... > > > > > > find . -inum $( /bin/ls -i | fgrep '?' | awk '{print $1}' ) > > > -print0 \ > > > > > > | xargs -0 rm -f > > > > That is a lot of work when you could have just > > > > rm -- ??????????????? > > This will delete all files that have a name the length of 15 > characters. > > > The "--" tells rm that what follows is a file name. > > But first, the ?'s are expanded by the shell to match any file with a > name of 15 characters. I had always used the -i to go along with it. I tried it with ??? and abc and a "rm -- ???" deleted both files, which wasn't what I expected if wildcarding was turned off with the "--". Kent > > > Kent > > > > -- > > Kent Stewart > > Richland, WA > > > > http://users.owt.com/kstewart/index.html > > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > > with "unsubscribe freebsd-questions" in the body of the message > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message -- Kent Stewart Richland, WA http://users.owt.com/kstewart/index.html To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message