Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Feb 2003 16:54:09 +0000
From:      Daniel Bye <dan@slightlystrange.org>
To:        questions@freebsd.org
Subject:   Re: how to delete a file called ????
Message-ID:  <20030212165409.GC60013@catflap.home.slightlystrange.org>
In-Reply-To: <20030212111232.A6759@skytrackercanada.com>
References:  <20030212111232.A6759@skytrackercanada.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Feb 12, 2003 at 11:12:32AM -0500, David Banning wrote:
> I have a file called ???????????????
> 
> Yes, the file is a bunch of question marks.
> 
> I can't seem to clean it away.
> 
> rm ????????
> rm '????????'
> rm "????????"
> 
> all do not work.

rm -i -- ?*

The "--" token tells rm that anything coming after it is to be treated as
an argument, not another option.

If your shell supports it, you may be able to type "rm -i ?<TAB>", and
let the shell work it out for you.

You can also try ls -i to get the inode number of the file, then use
find to kill it:

$ ls -i
174370 ???????
$ find . -inum 174370 -exec rm {} \;

Use -ok instead of -exec if you are paranoid, as it will ask you to 
confirm before doing anything.

-- 
Daniel Bye

PGP Key: ftp://ftp.slightlystrange.org/pgpkey/dan.asc
PGP Key fingerprint: 3D73 AF47 D448 C5CA 88B4 0DCF 849C 1C33 3C48 2CDC
                                                                     _
                                              ASCII ribbon campaign ( )
                                         - against HTML, vCards and  X
                                - proprietary attachments in e-mail / \

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?20030212165409.GC60013>