Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Feb 2003 12:12:19 -0800
From:      Matthew Hunt <mph@astro.caltech.edu>
To:        parv <parv_fm@emailgroups.net>
Cc:        David Banning <david@skytracker.ca>, questions@FreeBSD.ORG
Subject:   Re: how to delete a file called ????
Message-ID:  <20030212201219.GA84741@wopr.caltech.edu>
In-Reply-To: <20030212192143.GA7742@moo.holy.cow>
References:  <20030212111232.A6759@skytrackercanada.com> <20030212192143.GA7742@moo.holy.cow>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Feb 12, 2003 at 02:21:43PM -0500, parv wrote:

>  find . -inum $( /bin/ls -i | fgrep '?' | awk '{print $1}' ) -print0 \
>  | xargs -0 rm -f

I'm going to go out on a limb and guess that the filename does not really
consist of question marks, but rather of unprintable characters that ls
displays as '?'.  Note:

# Note that ^A is a literal control-A, typed with control-V control-A
$ echo > ^A
$ ls
?

I recommend finding the inode number of the offending file:

$ ls -li
total 1
1238024 -rw-rw-r--  1 mph  mph  1 Feb 12 12:07 ?

The inode number in this case is 1238024.  Then you can double-check and
delete it with find:

$ find . -inum 1238024 
./+
$ find . -inum 1238024 -delete

(Note that find displays the name differently from ls.  It looks like a
bold "+" in my xterm.)

-- 
Matthew Hunt <mph@astro.caltech.edu> * Inertia is a property
http://www.pobox.com/~mph/           * of matter.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030212201219.GA84741>