First, there is no original file in the case of hard links; all hard links are equal.
However, hard links aren’t involved here., as indicated by the link count of 1 in ls -l
’s output:
$ ll -i /usr/bin/bash /bin/bash 1310813 -rwxr-xr-x 1 root root 1183448 Jun 18 21:14 /bin/bash* 1310813 -rwxr-xr-x 1 root root 1183448 Jun 18 21:14 /usr/bin/bash*
Your problem arises because of a symlink, the bin
symlink which points to usr/bin
. To find all the paths in which bash
is available, you need to tell find
to follow symlinks, using the -L
option:
$ find -L / -xdev -samefile /usr/bin/bash 2>/dev/null
/usr/bin/rbash
/usr/bin/bash
/bin/rbash
/bin/bash
I’m using -xdev
here because I know your system is installed on a single file system; this avoids descending into /dev
, /proc
, /run
, /sys
etc.