45

Is there any way to quickly scroll through text-heavy output in Terminal such as man pages ? Using the up and down arrows only move the screen one line at a time; is there any way to scroll faster?

Daniel
  • 34,803
JFW
  • 4,574
  • 3
    The most direct answer to your question is: In Terminal's default keyboard map, adding the Shift modifier to Page Up/Down and Home/End will send scrolling commands to the tty instead of scrolling the terminal view. You can customize the keyboard map if you want to make it send scrolling commands without requiring the Shift modifier. – Chris Page Sep 08 '11 at 12:27
  • Press h while in man page to see all shortcuts – DanSkeel Jun 25 '15 at 12:13
  • Related: https://unix.stackexchange.com/questions/1841/tricks-and-tips-for-finding-information-in-man-pages – Anton Tarasenko Nov 16 '17 at 16:35

10 Answers10

58

If I understood you correctly, you want to skim through manual pages more efficiently.

By default, man uses less as its pager. In less, you can use:

  • Space or f or Control ⌃-f to advance one page
  • d or Control ⌃-d to advance half a page
  • b or Control ⌃-b to go back one page
  • u or Control ⌃-u to go back half a page

You can get the full list of less keyboard commands in its manual page. If you don't like the default pager, you can set MANPAGER or PAGER environment variables to specify a different program for controlling the pagination of man pages that are longer than one screen.

lobi
  • 149
6

You can open man pages in a single, scrollable window from Terminal's Help menu. Just type the command into the search field in the Help menu, then click the command in the search results to open its man page. It may occasionally take a few seconds for the command to appear in the search results.

You can also find most man pages online, with Apple-specific man pages found on apple's developer library. I generally google with apple man [command] replacing [command] with the actual command. One nice thing about this method is you can easily bookmark man pages you use frequently.

joelseph
  • 10,862
  • 3
    Searching for man pages in the Help menu works in Snow Leopard (10.6) as well. Lion has a number of enhancements: There are convenient commands in the Help menu to look up man pages for selected text, and they're available in the contextual menu, as well as Services so you can use them from other applications (you have to enable them in System Preferences > Keyboard > Keyboard Shortcuts > Services). You can also Command-Double-Click to open man page references "open(1)" and URLs "x-man-page://1/open" for easy navigation between man pages. – Chris Page Sep 08 '11 at 12:13
  • 2
    If there is no selection, the Help menu commands will look to the left of the cursor for a search term or man page reference. I use this all the time to look up a command after beginning to enter it on the command line. The "Open man Page" commands are the equivalent of man and "Search in man Pages" are equivalent to apropos. The Help menu and contextual menus recognize man page references in the form "1 open", "open 1" and "open(1)", as well as "x-man-page://1/open". – Chris Page Sep 08 '11 at 12:15
  • 2
    Man page terminals use the "Man Page" settings profile, so you can customize their appearance. Because the default window position is remembered separately for each profile, you can place man page windows conveniently on screen and new ones will show up in the same location (I place them at the right edge of the display, so they don't cover my primary terminal windows). – Chris Page Sep 08 '11 at 12:21
  • 1
    Also, if there are no running processes, Terminal supports a few pager commands. These are especially convenient for reading man pages: Space/Shift-Space = Page down/up, f/b = Page down/up, Return = Line down, Up/Down Arrow = Line up/down, </> = Home/End – Chris Page Sep 08 '11 at 12:21
  • Thanks @ChrisPage — http://meta.apple.stackexchange.com/q/1247/8546 proposes hyperlinking of x-man-page:// URLs. – Graham Perrin Mar 31 '12 at 17:22
  • @Graham Perrin, As much as I like the proposal it's a terrible idea. If someone happens to be browsing on iOS or Linux and needs the information linked using x-man-page:// then what? – l'L'l Jul 04 '14 at 01:50
4

Shift ⇧-Page Up ⇞ and Shift ⇧-Page Down ⇟ will move man pages a page at a time.

(On a laptop or other smaller keyboard, the keystrokes are usually Shift ⇧-Fn-Up Arrow ↑ and Shift ⇧-Fn-Down Arrow ↓.)

Cajunluke
  • 17,704
3

For non-Apple specific commands which tend to be the same across various UNIX platforms something I do is Google man [command] in a browser. The top result will almost always be an HTML-ified man page.

2

This answer gets around your question: Install Bwana.

This will open man pages in the browser. I've used this for years and it's one of my favorite additions for Terminal functionality.

1

I would recommend ManOpen, which allows you to open a man page in a normal text window.

You can also create an alias (let me know if you need help with this) using

pman() {
    man -t "${1}" | open -f -a Preview
}  
nohillside
  • 100,768
daviesgeek
  • 38,901
  • 52
  • 159
  • 203
1

I usually just use

  • z to move forward one window
  • w to move back one window
nohillside
  • 100,768
0

I have an app 'man reader' that lists all man pages on left and you can select one and it shows the man page in a Mac window. Runs on Sierra and is pretty nice. Can scroll man page up or down.

Natsfan
  • 14,185
0

In VSCode on Mac

  • g to go to the beginning of man pages.
  • G to go to the end of man pages.
hustnzj
  • 111
-2

For me, on OSX, [fn] + [enter] works.