#!/bin/bash
#                       /usr/local/bin/find_dup_inodes
# https://crystalfaeries.net/posix/bin/find_dup_inodes
# celeste@crystalfaeries.net FIND_DUP_INODES 2021-03-13 00:32:01+00:00
# Feed: All commands
# Title: find hard linked files (duplicate inodes) recursively
# Author: dmmst19
# Date: Sun, 13 Sep 2020 12:12:58 -1000
# Link: http://feedproxy.google.com/~r/Command-line-fu/~3/dqM5Q-FFyQU/find-hard-linked-files-duplicate-inodes-recursively
#  
# $ find . -type f -printf '%10i %p\n' | sort | uniq -w 11 -d -D | less If you 
# have two sets of files that may share hard-linked files, it can be useful to 
# identify which ones are hard links to same underlying inode (file). This command
# shows you all of those, sorted by inode#. In my example the two directory trees 
# to compare share a common parent, so I run the command in that parent and just 
# use find . to start from the current directory. If yours are in different 
# locations, you can pass both paths to find: find /directory1 /directory2
# -type f -printf '%10i %p\n' | sort | uniq -w 11 -d -D | less 
# http://www.commandlinefu.com/commands/view/25007/find-hard-linked-files-duplicate-inodes-recursively (link)
# http://feeds2.feedburner.com/commands/by/dmmst19 (link)

find . -type f -printf '%10i %p\n' | sort | uniq -w 11 -d -D | less -X
