44

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?

3
  • 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 8, 2011 at 12:27
  • Press h while in man page to see all shortcuts
    – DanSkeel
    Jun 25, 2015 at 12:13
  • Related: unix.stackexchange.com/questions/1841/… Nov 16, 2017 at 16:35

10 Answers 10

57

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.

8
  • 12
    You can also press h when viewing man pages to show help.
    – ocodo
    Sep 7, 2011 at 0:32
  • 3
    / starts search mode, which lets you jump to a word of your choice.
    – user588
    Sep 7, 2011 at 3:29
  • 2
    And p and n focus the previous and next results in search modes.
    – Lri
    Aug 21, 2012 at 9:37
  • 1
    Also, for better experience enable option as meta key. Terminal preferences > Profiles > Keyboard > Use Option as Meta key
    – DanSkeel
    Jun 25, 2015 at 11:11
  • 1
    @user5077, What does d and u stand for?
    – Pacerier
    Nov 1, 2017 at 19:35
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.

6
  • 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 8, 2011 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 8, 2011 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 8, 2011 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 8, 2011 at 12:21
  • Thanks @ChrisPage — meta.apple.stackexchange.com/q/1247/8546 proposes hyperlinking of x-man-page:// URLs. Mar 31, 2012 at 17:22
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 ↓.)

2
  • 1
    For me, on OSX 10.8, the key combinations are [fn]-[up] and [fn]-[down] respectively.
    – user456584
    Oct 18, 2012 at 22:06
  • On OS X Yosemite the same key combinations are valid.
    – politicus
    Jun 16, 2015 at 16:30
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 usually just use

  • z to move forward one window
  • w to move back one window
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
}  
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.

0

In VSCode on Mac

  • g to go to the beginning of man pages.
  • G to go to the end of man pages.
2
  • The question is about the man pages in the Terminal app, not vsCode.
    – Alper
    Aug 24, 2022 at 5:47
  • @Alper Hi, Alper. I meant in the Terminal tab of panel view in VSCode. Thanks.
    – hustnzj
    Aug 24, 2022 at 13:22
-2

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

You must log in to answer this question.

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