Sunday, August 29, 2010

Remove a file which is named in special characters

There are times when you might encounter files which might have unusual names like "*^^^2as" (I have received complains from user that they were not able to delete such files). It was not possible to delete the files by name.

Solution: Delete files with inode number

Get the inode of a file using 'ls -li' command

                     ls -li

Now use find command command to delete the fie using the inode number.

                    find -inum -exec rm -i {} \;

No comments:

Post a Comment