Is there a command like namei for OS X?

Solution 1:

You can download the source code for namei from SourceForge. To compile, you need to delete the #include <sys/sysmacros.h> line from stat.c, then run make.

Solution 2:

Macports has a port of it: https://trac.macports.org/browser/trunk/dports/devel/util-linux/Portfile

I did try to make a homebrew recipe for it, but there were some issues getting it to compile. It's definitely possible, but there are some problems to work out.

Update:

I've made a formula that can be installed with:

brew install mkdryden/homebrew-misc/namei

This is the original version, not the version pulled into util-linux. (not sure how much has changed since the original)