Discussion:
Is there a namei utility in FreeBSD?
James E Keenan
2017-03-06 14:12:14 UTC
Permalink
In Linux, there is a userland utility 'namei' which enables a user to
"follow a pathname until a terminal point is found". Invoking it on,
say, a symlink produces output like this:

#####
$ namei /usr/bin/bundledoc
f: /usr/bin/bundledoc
d /
d usr
d bin
l bundledoc -> ../share/texlive/texmf-dist/scripts/bundledoc/bundledoc
d ..
d share
d texlive
d texmf-dist
d scripts
d bundledoc
- bundledoc
#####

Is there an equivalent utility in FreeBSD? In 10.3 and 11.0, I could
only find namei in man 9, which is C-level facility, not an executable
utility.

Thank you very much.
Jim Keenan
Anton Yuzhaninov
2017-03-06 16:02:15 UTC
Permalink
Post by James E Keenan
In Linux, there is a userland utility 'namei' which enables a user to
"follow a pathname until a terminal point is found". Invoking it on,
If you need to find a target of symlink (or symlink chain) you can use
realpath(1).
James E Keenan
2017-03-06 16:43:25 UTC
Permalink
Post by Anton Yuzhaninov
Post by James E Keenan
In Linux, there is a userland utility 'namei' which enables a user to
"follow a pathname until a terminal point is found". Invoking it on,
If you need to find a target of symlink (or symlink chain) you can use
realpath(1).
Thanks for mentioning that. However, while the example I gave was that
of a symlink, and while both namei and realpath are good for displaying
information about symlinks, my central question was whether there was an
equivalent to namei in FreeBSD. namei identifies the nature of each
component in the resolved path; realpath does not.

Thank you very much.
Jim Keenan
Trond Endrestøl
2017-03-08 08:23:46 UTC
Permalink
This post might be inappropriate. Click to display it.
Loading...