42

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?

0

5 Answers 5

23

Hello from the future world of 2022!

As benwiggy mentioned below, the short answer is https://ss64.com/osx. It's the only reasonably up-to-date, online-viewable, searchable, and cross-referenced repository of macOS man pages that I'm personally aware of right now.

That site's a fantastic resource for Windows scripting languages, too, if you are of that persuasion. If it has helped you, and you're feeling magnanimous, maybe buy the site's maintainer, Simon, a beer, because he's been hosting that site and answering posts in the forums for decades.

Here are some other options, though:

  • you can find the raw roff source for some commands at https://opensource.apple.com/source, or with a web search, e.g. site:opensource.apple.com/source stat.1
    • see below for how to format that for on-screen reading or as PostScript
  • if the man page you're looking for is in section 2, 3, or 3x of the manual, you can link to the iOS documentation
    • if you need a man page for one of the other sections, you could link to an OpenBSD or FreeBSD version of the man page instead; most of the "user commands" (section 1) in macOS came from BSD anyway
  • Mojave (10.14) man pages on unix.com
    • poor site design, not effectively searchable, and not cross-referenced
  • https://github.com/keith/xcode-man-pages, viewable online here; thanks to cachius for the tip
    • an HTML export of Xcode's man pages, with section anchors, but not cross-referenced to other man pages
    • either clone the repo or use the included script to generate on your own system
  • Darwin man pages on the Wayback Machine
    • this is a July 2017 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 certain pages

I have a Mac, why wouldn't I just use man in the terminal?

It's when you don't have a Mac that these resources are useful, for example, when writing shell scripts which need to work on Linux and macOS/BSD.

In that regard, the Heirloom Project's man pages can also be helpful for ascertaining what is the lowest common denominator behavior (e.g., which options are definitely supported) for many "Unix toolbox" commands.

Formatting roff source mini how-to

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
4
  • basically "Hello from the future world" is correct for every given answer there is.
    – bot47
    Nov 9, 2019 at 9:09
  • If the future world actually fixed your problem, and bothered to report back. But sometimes the future world just locks your thread instead, with no resolution for anybody. :/
    – Kevin E
    Nov 14, 2019 at 16:08
  • 2
    A very extensive resource is keith.github.io/xcode-man-pages - A HTML export of Xcode's man pages. See the repo for the generating script. Try this one if the other resources don't list your manpage. @TheDudeAbides Maybe you can add it to the list?
    – cachius
    Sep 22, 2022 at 8:38
  • @cachius You can add it to the answer yourself - your edit will be placed in a queue for higher reputation users to approve
    – mmmmmm
    Sep 22, 2022 at 16:32
12

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:

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.

1
  • The site:opensource.apple.com/source trick is brilliant. For a browseable list of all manual pages from all sections of the manual (albeit dating back to the OS X 10.9 days) see my answer below.
    – Kevin E
    Nov 9, 2019 at 1:56
5

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

0
4

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

I used to use this utility, Bwana, which converts man pages to HTML in Safari on-the-fly. It hasn't been updated for some time, though the source code is available.

1
  • 1
    SS64 is a really good resource for anyone who works in a command-line environment, on any OS. It's well-structured, comprehensive, and uncluttered. If only Microsoft's (or Apple's) official documentation were up to this standard.
    – Kevin E
    Nov 14, 2019 at 16:22
0

You could also use tldr++

A quick an easy way to see a couple of examples of the use of a command.

Update to answer comment

Here are two examples, so one knows what it looks like.

tldr 1

tldr 2

So I'd say that it's a possible addition to the man-pages.

5
  • 2
    What does it do? are they web pages of macOS commands or of Linux commands? An answer should work without a link - the link is there for citation or further information
    – mmmmmm
    Apr 29, 2022 at 11:21
  • @mmmmmm - I've added some examples.
    – Zeth
    Sep 22, 2022 at 11:50
  • If it is text please paste as text - I can't read the writing
    – mmmmmm
    Sep 22, 2022 at 12:39
  • WHere does the information come from? Is it actual;ly Apple or is it Linux stuff which is often wrong
    – mmmmmm
    Sep 22, 2022 at 12:40
  • TLDR shows not man pages but curated usage examples. This didn't answer how to get specifically OSX results. I suppose it defaults to current OS, but the question is most useful when not running on OSX, otherwise one would just use man. The interactive tldr++ apparently takes an env var e.g. env TLDR_OS=osx tldr cal (untested). github.com/tldr-pages/tldr-python-client takes a flag e.g. tldr --platform=linux cal vs. tldr --platform=osx cal show different flags ✔. Both take data from github.com/tldr-pages/tldr repo (e.g. pages.es/osx dir has Spanish OSX) Dec 5, 2023 at 17:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .