ls -i and stat are not fast enough.
Camelot's suggestion using:
ls -R -i
should be as fast as 'find'. I got so focused on improving your 'find' in my reply, that I totally forgot that ls -R -i will effectively do the same thing, with less junk thrown in.
... so I can compare 2 sets of directories which both have hard links to the same file.
The
diff -r directory_1 directory_2
can do directory comparisons. Not sure if this is of interest or not. "man diff" will give you all the 'diff' options available.
I am surprised the inumbers can't simply be listed for direct access to a file rather than having find run through the hierarchy.
Unix file systems generally DO NOT allow accessing a file via their inode number. They often depend on access permissions in the parent, grandparent, great grandparent, etc... to control access to a file. By passing the file system name space and going directly to a file via the inode number would upset the security balance.
Of course every file system implementation is different, and it is always possible that a specific implementation has a file system specific ioctl() or fcntl() that can do that, but it is NOT a generic Unix feature, short of reading the raw disk, and parsing the file system on-disk structures (also a security violation, so only root or the owner of the file /dev/devicename is allowed to do that). fsck is one of those things that needs root access, and fsck actually has different flavors of fsck for different file system implementations
/sbin/fsck
/sbin/fsck_cs
/sbin/fsck_exfat
/sbin/fsck_hfs
/sbin/fsck_msdos
/sbin/fsck_udf
Some have the inodes scattered all over the place, some have them centrailized, some may have a table of inode pointers, etc.... Again, all implementation dependent. And unless the file system provides an API separate from the file system, generally speaking a user program cannot access a file via its inode number.
I work on Unix file systems during the day.