Install linux manpages on macOS
I have to regularly work with Linux machines that don't have man installed (don't ask me why). Is it possible to install Linux man pages on macOS? I'm thinking about help for commands like ip
or ipset
, or perhaps GNU variants of common Unix tools. I've been using manpages.me, but it's quite cumbersome as it's not as responsive as a command line tool and also defaults to displaying FreeBSD manpages.
Here's one way to do it:
- Go to your Linux machine of choice and tar/zip the whole
/usr/share/man
directory. - Copy the archive to your Mac and uncompress it, say into
~/Documents/linux-man
. - Use the
-M
switch to makeman
search in that folder:man -M ~/Documents/linux-man ip
- Create a shell alias, function, or wrapper script for more convenient use. For example:
lman() { man -M ~/Documents/linux-man "$@" }
. Then you can dolman 7 ip
.