I want to see the man page of some c standard library functions in Mac OS X. When I typed in man setsockopt
, it returns: No manual entry for setsockopt
. Does that mean I haven't installed man pages for c standard? How should I install it?
macOS is not feature complete out of the box when it comes to development. Installing the Xcode command line tools will give you what you need, as well as a compiler etc.
For macOS and newer versions of Mac OS X, installing the Command Line Tools package is done with the command xcode-select --install
.
For older versions of Mac OS X you'll need to install Xcode (free in the Mac App Store) first. Then you can install the Command Line Tools module after you installed Xcode, by going into Xcode->Preferences->Downloads->Components
The piece in all this that was missing for me was that I had previously set an environment variable MANPATH, and this did not point to all the places man pages could be found. Deleting that variable was enough to fix my problem.
You can copy a man page from another system, such as Ubuntu.
First, make sure you have a working Docker installation.
Then, use Docker to copy the man pages of the latest version of Ubuntu Linux to your host:
docker run -v $HOME/ubuntu-man:/host-ubuntu-man ubuntu:latest bash -c 'echo y | unminimize ; apt-get install -y manpages manpages-dev manpages-posix manpages-posix-dev net-tools; cp -Rf /usr/share/man/* /host-ubuntu-man'
Finally, add this line to your ~/.zshrc (if you use ZSH) or ~/.bashrc (if you use Bash):
alias lman="man -M $HOME/ubuntu-man"
At last and try our new lman command:
lman ifconfig
For more details, you can refer to this link:read-the-linux-manual-pages-on-mac-and-bsd-directly-from-the-terminal
© 2022 - 2024 — McMap. All rights reserved.
/etc/manpaths
contain? – Alfredoalfresco/etc/manpaths
contains/usr/share/man /usr/local/share/man
.Mac os 10.8.4, and Xcode Version 4.6.3 (4H1503) – Infare