From owner-freebsd-questions@FreeBSD.ORG Wed Nov 24 04:56:14 2004 Return-Path: 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 209B016A4CE for ; Wed, 24 Nov 2004 04:56:14 +0000 (GMT) Received: from wolfgang.edbrown.net (wolfgang.edbrown.net [209.181.56.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id AAAE843D5A for ; Wed, 24 Nov 2004 04:56:13 +0000 (GMT) (envelope-from ed@lexingrad.net) Received: from localhost (localhost.edbrown.net [127.0.0.1]) iAO4FZJ6052703 for ; Tue, 23 Nov 2004 20:15:35 -0800 (PST) (envelope-from ed@lexingrad.net) Date: Tue, 23 Nov 2004 20:15:35 -0800 (PST) From: ed@lexingrad.net X-X-Sender: ed@wolfgang.edbrown.net To: freebsd-questions@freebsd.org Message-ID: <20041123200606.S41902@wolfgang.edbrown.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: deleting directories with ??? in name X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Nov 2004 04:56:14 -0000 I've written a command line utility to deal with this type of thing. It's called duc. You can get it at: http://ed.lexingrad.net/duc/ duc takes out unprintables, extended ascii set chars, spaces and punctuations, with options to allow you to take out some while leaving others. Also there is a test only option as well as an option to restore spaces. By default it replaces chars with an underscore, but it can optionally delete the offending chars directly. duc is written in assembly. I hope it helps some people out. Edward Brown Erik Trulsson wrote: > On Mon, Mar 15, 2004 at 03:51:37PM -0800, Derrick Ryalls wrote: > >>>I've tried lynx, but it did not display the files. >>>I tried emacs, but I was only able to rename two of the >>>directories to other names I could delete; the other two gave >>>me an error of illegal character. I tried 'rm -i -- ?*' but >>>it didn't find the files. I tried 'find . -inum 146 -delete' >>>but while it gave no error message, the files/directories remain. >>> >>>Help! How do I delete these odd directories? >>>Please CC me in your response as I'm not currently >>>subscribed to the List. >>> >> >>#mkdir dir?me >>#rmdir dir\?me > > > That assumes that filenames actually contain questionmarks. > ls(1) by default displays all unprintable characters as question marks. > To see what the filenames actually are use 'ls -aB'. > > To delete files with strange names you can always do a 'rm -i *' and > answer 'y' only for the weird files. 'rm -i *' returns "no match" 'ls -aB' shows me the file names, but even after carefully typing in what it shows me in an 'rm' command (name in quotes) says not found. There are \216, \235, \237, and \377 characters in the names, if this matters. Thanks. <