Thursday, July 24, 2008

How to: Linux/UNIX Delete or Remove Files With Inode Number

Sometime accidently, we create file with special character and its hard to remove file using rm command.

  • Find out the inode number coressponding to file name (:q)

    $ ls -il :q

    52155 -rw-rw-r-- 1 oracle dba 2310 Jul 24 14:52 :q
  • Use find command to remove file:
    find . -inum 52155 -exec rm -i {} \;

No comments: