I've run into situations where symlinks point to other symlinks causing me to have to run multiple ls commands to try to trace where the base file is stored. For example if I want to know the location of java program I run on centos I usually start with /bin/java and have to go 3-4 symlinks deep before I find the actual file's location.
Is there a simple clean command that will trace along all symlinks until it finds a real file and give me the location of the base file?
/bin/java
when you're given/opt/javasomething/bin/java
. That, of course would be significantly harder or next to impossible. – ilkkachu Oct 23 '20 at 21:44