Re: Unable to del an OS file with special char - need ideas

From: Nadeem M. Khan <nadeem.m.khan_at_gmail.com>
Date: Wed, 9 Jul 2008 23:27:25 +0400
Message-ID: <2ede0e110807091227u65fca197je576f641970e2403@mail.gmail.com>


On Wed, Jul 9, 2008 at 10:04 PM, vikram singh <vikramsingh120_at_gmail.com> wrote:
>
> Hi All,
>
> I have this file by name '-C' created by mistake. I am unable to delete
> this. Any ideas?
>
> [oraapp_at_greece app]# ls -l
> total 457636
> -rw-r--r-- 1 oraapp oraapp 435824640 Oct 4 2007 -C
> -rw------- 1 oraapp oraapp 32271367 Oct 4 2007 nohup.out

Theres more than one way to do it. :-)

Delete it by its inode number instead of its filename.

Get its inode number: ls -li
Verify, just to be sure: find . -inum xxxx Delete it: find . -inum xxxx -exec rm -f {}\;

This is particularly useful when you have *blank* filenames, or filenames that have characters which cannot be typed. (I'm still to figure out how these files get created.)

Regards,
NMK.

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Jul 09 2008 - 14:27:25 CDT

Original text of this message