[sf-lug] Simple way to track links-to-links to their final resolution?

Matt Price matt.price at utoronto.ca
Sun Dec 16 16:10:13 PST 2007

On Sun, 2007-12-16 at 15:50 -0800, RBV wrote:
> Note -- my question is NOT about Java or the JRE.
> My question IS about a recent adventure wherein I was obliged to locate then
> type the destination of multiple symbolic links to finally get to my
> computer's Java Runtime Environment (JRE).
> Simply put, something (I don't pretend to know what, exactly) configured one
> link pointed to another link which pointed to another link which pointed to
> another...
> So I used which, cd, and ls to follow a trail through three links before I
> finally found a counter-intuitively named executable, as follows:
> /usr/bin/java >
> /etc/alternatives/java >
> /usr/lib/jvm/java-gcj/jre/bin/java >
> ../../../../../bin/gij-4.1 (i.e., /usr/bin/gij-4.1)
> It was finally gij-4.1 which appears to be my computer's JRE(?)
> OKAY, MY QUESTION IS -- is there a command that lists the path taken through
> multiple links to the ultimate destination?  Surely one doesn't need to do
> this sort of detective work everytime a link references another?

readlink -f [linkname]

totally indispensable on systems that use update-alternatives!  


> Cheers, thanks, & see ya' all tomorrow (Monday) at the J'Cat,
> Riley
> _______________________________________________
> sf-lug mailing list
> sf-lug at linuxmafia.com
> http://linuxmafia.com/mailman/listinfo/sf-lug
Matt Price
matt.price at utoronto.ca

More information about the sf-lug mailing list