file with no name -- cannot be deleted

Nancy Rudins nrudins at ncsa.uiuc.edu
Tue Nov 7 14:33:11 UTC 2006


On Sun, 5 Nov 2006, Barry wrote:

> I have an annoying situation. I had a directory with a large number of
> files that I deleted with rm -rf, but one of the subdirectories was
> left with a file with no name -- seems to be an empty string. It looks
> like the inode for the directory and the inode for this file are one
> in the same.
>
> First, I call ls -li on the parent directory and see this
> $ ls -li
> 4232799 drwxr-xr-x 2 user user    16384 2006-11-05 17:31 yyy
>
> So it looks like it has stuff in it, but there is no name to the file within:
>
> $ ls -li yyy
> total 16
> 4232799 drwxr-xr-x 2 user user 16384 2006-11-05 17:31
>
> Of course I get:
> $ rm -rf yyy
> rm: cannot remove directory `yyy': Directory not empty
>
> and,
> $ rm yyy/*
> rm: cannot remove `yyy/': Is a directory
>
> and
> $ rmdir yyy/*
> rmdir: yyy/: Directory not empty
>
> Different utilities say different things:
>
> $ du -sh
> du: cannot access `yyy/': No such file or directory
> 16K     yyy
>
> Can anyone suggest what might have happened and how can I delete this.
>
> Tia
>

Hi,

If

rm -rf ./yyy

doesn't work try this since you have the inode number from ls -i :

find . -inum 4232799 -exec rm {}\;

Kind regards,
Nancy

Nancy Rudins    nrudins at ncsa.uiuc.edu
http://www.ncsa.uiuc.edu/~nrudins/

Take a sad song and make it better.  (lennon/mccartney)





More information about the ubuntu-users mailing list