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

后端 未结 4 1468
余生分开走
余生分开走 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:09

    There is no mapping from inode to name. The only way is to walk the entire filesystem, which as you pointed out is O(number of files). (Actually, I think it's θ(number of files)).

提交回复
热议问题