Sitemap

Tracking any binary on linux

2 min readMay 5, 2017

--

Let’s say you need to find out where your java installation is on linux.

Get Clerton Araujo’s stories in your inbox

Join Medium for free to get updates from this writer.

First, the hard way:

which java
Press enter or click to view image in full size
output of which java

Then, navigate through the links:

ls -l /usr/bin/java
Press enter or click to view image in full size
output of ls -l /usr/bin/java

And again…

ls -l /etc/alternatives/java
Press enter or click to view image in full size
output of ls -l /etc/alternatives/java

And again… Until it finds itself!

ls -l /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
Press enter or click to view image in full size
output of ls -l /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java is the same link searched

Great! Now the easy way:

readlink -f $(which java)
output of the easy way!

--

--