Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Open New Man Page From Terminal OS X Lion

· 6 min read · Home Tech

In this article
  1. What Are Man Pages and Why Do They Matter?
  2. How to Open a Man Page in Terminal
  3. Searching Within a Man Page
  4. Opening a Man Page in a Separate Window or GUI
  5. Common Problems and How to Solve Them
  6. Alternatives to Man Pages
  7. Frequently Asked Questions

To open a new man page from Terminal in OS X Lion, simply type man followed by the command name, like man ls. That’s the core answer—the man page displays right in the Terminal window, and you can navigate it with your keyboard. But there’s more to it than that: you can search within a man page, open a page in a separate window, or even read it in a GUI viewer, and we’ll cover all of that below.

What Are Man Pages and Why Do They Matter?

Man pages (short for “manual pages”) are the built-in documentation for Unix-like systems, including macOS. They’ve been around since the early 1970s, originating with the Unix operating system. Each command, system call, configuration file, and even some library functions have a man page that explains its purpose, syntax, options, and sometimes examples.

In OS X Lion (10.7), which Apple released in 2011, the Terminal app provides a direct interface to this documentation. Unlike many modern apps that rely on web-based help, man pages are offline, fast, and always present. They’re especially useful when you’re working without an internet connection or need a quick reference without leaving the command line.

For example, if you’re unsure how to use the grep command, typing man grep shows you every flag, from -i (ignore case) to -r (recursive search). This is the same documentation that system administrators have relied on for decades.

How to Open a Man Page in Terminal

The basic syntax is simple:

  • man command – opens the manual page for that command (e.g., man ls).
  • man -k keyword – searches the short descriptions of all man pages for a keyword (e.g., man -k copy lists all commands related to copying).
  • man -f command – shows a one-line summary of what the command does, equivalent to whatis.

When you run man ls, the Terminal switches to a pager (usually less) that lets you scroll through the document. You can use the arrow keys, Page Up/Page Down, or the spacebar to move forward a screen. Press q to quit and return to your normal prompt.

If the command you’re looking for has multiple sections (like printf, which exists both as a shell builtin and a C function), you can specify the section number: man 3 printf opens the C library documentation, while man 1 printf shows the shell command.

Searching Within a Man Page

Once you’re inside a man page, you often need to find a specific option quickly. The pager supports searching:

  • Press / followed by a search term and Enter to search forward (e.g., /recursive).
  • Press n to jump to the next match, and N for the previous one.
  • Press ?term to search backward.

This is a huge time-saver when a man page is long, like the one for bash which is thousands of lines. Instead of scrolling manually, you can jump straight to “COMMAND EXECUTION” or “JOB CONTROL”.

Opening a Man Page in a Separate Window or GUI

If you prefer to read the documentation in a separate window—so you can keep typing commands in Terminal—you have a few options:

  • man -t command | open -f -a Preview – This renders the man page as a PostScript file and opens it in Preview, where you can scroll, search, and print. The -t flag formats the page for typesetting, and the pipe sends it to the open command.
  • open x-man-page://command – This opens the man page in the built-in man page viewer in the Xcode documentation window (if Xcode is installed). For example, open x-man-page://ls.
  • Use a dedicated GUI app like ManOpen (a free third-party application) that integrates with Terminal. After installing it, you can type manopen ls to open the page in a separate window.

The first method works on a stock OS X Lion system without any extra software. The -t option sends the output through the groff typesetting system, and Preview handles the PostScript conversion automatically.

Common Problems and How to Solve Them

Even though man pages are straightforward, you might run into a few issues:

  • “No manual entry for command” – This means the command isn’t installed or its man page isn’t in the standard location. For example, some third-party tools installed via Homebrew place man pages in /usr/local/share/man, which is usually included by default. If not, you can add it to your MANPATH environment variable.
  • Man page appears garbled or with weird characters – This can happen if the terminal’s locale isn’t set correctly or if the man page uses a non-UTF-8 encoding. Setting export LC_ALL=en_US.UTF-8 in your ~/.bash_profile often fixes it.
  • You want to print or save a man page – Use man command | col -b > output.txt to strip formatting and save as plain text. Or use man -t command > output.ps to create a PostScript file.
  • Man page is too long and you want to search from the start – Press g to go to the top of the page, then use the search as described above.

If you’re using a newer macOS version, the behavior is largely the same, but the Terminal app has added features like split panes and tabs, which can make reading man pages side-by-side with your commands easier.

Alternatives to Man Pages

While man pages are the traditional reference, they aren’t the only way to get help:

  • info – The GNU project’s hypertext documentation system. Some commands, especially those from GNU, have more detailed info pages. Type info ls to see the difference.
  • --help or -h – Most commands accept a --help flag that shows a concise summary of options directly in the terminal. For example, ls --help gives a quick overview without the full man page.
  • Web-based resources – Sites like Apple’s man page archive or die.net offer searchable man pages online. This is useful if you’re not at a Mac.
  • Third-party cheat sheets – Many developers create one-page summaries for common commands. For instance, a “grep cheat sheet” shows the most-used flags at a glance.

Each has its strengths: man pages are comprehensive and offline, --help is quick and built-in, and web resources are convenient for cross-referencing.

Frequently Asked Questions

How do I quit a man page?

Press the q key. This exits the pager and returns you to the Terminal prompt. If you’re using a GUI viewer like Preview, just close the window.

Can I change the pager that man uses?

Yes. Set the PAGER environment variable to your preferred program. For example, to use less (the default on macOS), you don’t need to do anything. To use more, add export PAGER=more to your shell profile. You can also set MANPAGER specifically for man pages.

Why does my man page show “(END)” at the bottom?

That’s the pager’s indicator that you’ve reached the end of the document. Press q to exit, or use the arrow keys to scroll back up. If you see it immediately, it might mean the man page is very short.

How do I find a man page if I don’t know the command name?

Use man -k keyword to search the short descriptions. For example, man -k compress lists commands like gzip, zip, and compress. This is equivalent to the apropos command.

Are man pages different on OS X Lion versus Linux?

Yes, they can be. macOS uses BSD-style commands, so some options differ from GNU/Linux versions. For example, ls on macOS doesn’t have the --color flag by default. Always check the local man page rather than assuming Linux syntax works on a Mac.

Can I read a man page for a command that isn’t installed?

No, the man page is usually installed with the command. If you haven’t installed the software, there’s no man page. You can look up the documentation online, or install the package first.