2 ways that I can think of, you can use ls -l for both files. after "->" you can see the actual path.eg path
# ls -ltr msdfasdffff
lrwxrwxrwx 1 root root 10 Jun 30 19:05 msdfasdffff -> blah.sh
you can get the file name using
# ls -l msdfasdffff | awk -F"-> " '{print $NF}'
blah.sh
then you can compare it with another link.
another way is to use find
# var1=$(find . -name "s1" -printf "%l")
# var2=$(find . -name "s2" -printf "%l")
then you can compare 2 variables using if / else
source
share