commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
If I type 'man something', I want it to find the manpage in the same order as my PATH.
You can add something like this to your .bashrc
# Add my MacPorts, my personal utilities and my company utilities to my PATH.
# Now set the manpath based on the PATH, after man(1) parses man.conf
# - No need to modify man.conf or manually modify MANPATH_MAP
# - Works on Linux, FreeBSD & Darwin, unlike /etc/manpaths.d/
# Must unset MANPATH first. MANPATH is set on some systems automatically (Mac),
# which causes manpath to ignore the values of PATH like /opt/local/bin (MacPorts).
# Also MANPATH may be deprecated. See "SEARCH PATH FOR MANUAL PAGES" in man(1)
# manpath acts differently on Solaris, FreeBSD, MacOSX & GNU. This works everywhere.
Note that MacOSX, FreeBSD & Linux have fancier ways to do some of this. (e.g. 'man --path' or 'man -q'), but this command is more universal and should work everywhere.
There is 1 alternative - vote for the best!
If you can do better, submit your command here.
You must be signed in to comment.