Monday, July 24, 2006


I stumbled today on namei, an executable found on Linux. I'm not sure why I've never been exposed to it before, FreeBSD not packaging it comes to mind, but this is truly useful. In a world of softlinks, with all their benefits and drawbacks, namei follows the trail until it reaches a real end point.

Here's a sample output on a RHEL box:

# namei `which java`
f: /usr/bin/java
d /
d usr
d bin
l java -> /etc/alternatives/java
d /
d etc
d alternatives
l java -> /usr/lib/jvm/jre-1.4.2-gcj/bin/java
d /
d usr
d lib
d jvm
l jre-1.4.2-gcj -> java-1.4.2-gcj-
d java-1.4.2-gcj-
d jre
d bin
- java

The best part is that I know exactly how this was coded ... and that I don't have to do it myself.


Post a Comment

<< Home