What is the fastest way to find all the file with the same inode?

后端 未结 4 1466
余生分开走
余生分开走 2021-02-03 12:46

The only way I know is:

find /home -xdev -samefile file1

But it\'s really slow. I would like to find a tool like locate. The real

4条回答
  •  臣服心动
    2021-02-03 13:13

    What I'd typically do is: ls -i to get the inode of that file, and then find /dir -type f -inum -mount. (You want the -mount to avoid searching on different file systems, which is probably part of your performance issues.)

    Other than that, I think that's about it.

提交回复
热议问题