home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


UNIX Power Tools

UNIX Power ToolsSearch this book
Previous: 23.12 Using Wildcards to Delete Files with Strange Names Chapter 23
Removing Files
Next: 23.14 Handling a Filename Starting with a Dash (-)
 

23.13 Deleting Files with the Null Name

I write this article with fear and trepidation; I've never done this, and clri is strong medicine. However, it's something that needs to be said.

I've seen several reports about files with null names - they evidently arise through some bad interaction between PCs running NFS (1.33 ) and UNIX systems. [I've heard several reports of files with slashes (/ ) in their filenames. They came via NFS from Macintoshes. The method below should help with them. -JP ] For lots of reasons, it's virtually impossible to delete a null-named file. The following technique has been recommended:

  • Use ls -ailF to find out the inode number (1.22 ) of the directory with the null filename.

  • Become superuser and dismount the filesystem that contains the directory with the null filename.

  • Use the command clri  filesystem inode to "clear" the directory's inode, where inode is the inode number of the directory that contains the null filename and filesystem is the name of the filesystem that contains this directory.

  • Run fsck , and let it repair the damage.

- ML


Previous: 23.12 Using Wildcards to Delete Files with Strange Names UNIX Power Tools Next: 23.14 Handling a Filename Starting with a Dash (-)
23.12 Using Wildcards to Delete Files with Strange Names Book Index 23.14 Handling a Filename Starting with a Dash (-)

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System