Does Apple provide a web site with content of `man` pages for the command-line commands bundled with Mac OS X?

I want to provide URL links to man page content at apple.com as an authoritative source of information. Describing and quoting the local man page is awkward.

Does Apple provide man pages on the web?


Solution 1:

The old online index seems have to vanished. You can however find the source code of manual pages on https://opensource.apple.com/. This site hosts historical versions as well.

For example:

  • fputs(3) - https://opensource.apple.com/source/Libc/Libc-1272.200.26/stdio/FreeBSD/fputs.3.auto.html
  • ls(1) - https://opensource.apple.com/source/file_cmds/file_cmds-272.220.1/ls/ls.1.auto.html
  • grep(1) - https://opensource.apple.com/source/grep/grep-28/grep/doc/grep.1.auto.html

Unfortunately there is no overview of all manual pages, so you have to manually check directory indexes or use something like site:opensource.apple.com/source "ls.1" in DuckDuckGo or Google.

Solution 2:

Hello from the future world of 2019!

Sadly, it seems a web search for site:opensource.apple.com/source stat.1 is still the fundamental state of things, if you want "official" documentation from apple.com.

Here are some alternatives:

  • SS64.com under the "macOS" section, as mentioned in benwiggy's answer below.
    • a great resource for Windows scripting languages, too, if you are of that persuasion
    • maybe buy the site's maintainer, Simon, a beer (scroll to the bottom for the PayPal link) if you like it, because he's been serving this up ad-free and answering posts in the forums for literally decades
  • Mojave (10.14) man pages on unix.com
    • the site design here uses an excruciating amount of whitespace, and you'll probably need to zoom out to see the man pages in their entirety
  • Darwin man pages on the Wayback Machine
    • this is a May 2018 capture, for OS X 10.9 (Mavericks), and there are still some holes, so you may need to go back farther in time with the Wayback Machine to get some of the pages

Update: By the way, you can format the raw roff source of the man pages on opensource.apple.com into something human readable like this:

  1. copy the "plain text" URL:

    enter image description here

  2. fetch that URL with curl and format it for viewing on-screen with groff:

    # use 'wget -qO -' if you don't have 'curl'
    curl -s https://opensource.apple.com/source/grep/grep-28/grep/doc/grep.1 \
      | groff -man -T utf8 \
      | less
    

Some side notes about that groff command:

  • add -rLL=${COLUMNS}n to use the full width of your terminal, if 80 columns doesn't do it for you; the man command usually does some magic to autodetect this from your terminal size (reference)
  • you can substitute groff -man -T ps > ~/Desktop/grep.1.ps for that last part to get a beautiful PostScript manual page that you can open and print with Preview.app, if that's your thing

Solution 3:

In the past, Apple provided these pages online, for example: https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/ls.1.html for the ls command.

Source: Dr Drang

Now you would need to find them mirrored elsewhere or use https://archive.org

Solution 4:

There are some MacOS man pages here, though I don't know how complete the list is.