For example, I have a file a, and I do the followings.
ln -s a b
ln -s b c
ln -s c d
If I use readlink d, I will get c. So I have to run many times to get a.
Is there an easy way to get a?
Update:
If I want to locate the original file of /usr/bin/java, I have to do it many times to get /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java. The files and links are not in the same folder.
which command– Manyam Nandeesh Reddy Apr 01 '21 at 21:04