Tuesday, March 9, 2010

Rename file with special char in filename

Sometimes you cannot rename a file cause the filename contains a special char that cannot be recognized. In this case you can rename a file by its inode.

Its as simple as this:
ls -il (to get the inode)
find . -type f -inum "inode num goes here" -exec mv {} newfilename \; (find file by inode and rename it)