All Articles

Dealing with Linux Files via inode

filesystem

In the UNIX/Linux system, name-garbled files are generated in some cases. It’s hard to operate on such kind of files via their file names.

Based on the implementation of the UNIX/Linux file system, each file is associated with inodes. We can operate on any file with inode as an alternative.

  1. Get the inode of the name-garbled file
$ ls -il
total 125252
...
200556696 -rwxr-xr-x 1 x x 676 Mar 30 15:20 common.sh
...
  1. Process files based on the inode, for example, delete
$ find . -inum 200556696 -exec rm {} \;

Published Mar 30, 2012

Flying code monkey