7

When looking at man-pages in the terminal I often come across words with bracketed numbers after them (like mkdir(2)). If I am not mistaken, these are links or references to other man-pages.

If so, how can I follow that link / find the referenced page?

If not, what does this mean?

schtandard
  • 267
  • 3
  • 9

3 Answers3

4

If you want to see all man pages about a command, one after the other, use the -a to man:

man -a mkdir

then use the SPACE bar, then q to quit the first page and then the ENTER key to see the next (2) page.

To find out more you can lookup the manpage of man using

man man
mcantsin
  • 1,254
  • 1
  • 12
  • 29
3

Not with less(1), which is default pager in Ubuntu (and GNU in general).

There are several tools available, things that work in terminal and is not a full-blown GNU Emacs is called info(1):

$ info apt

TAB to focus the next link, M-TAB¹ for the previous link, Enter to follow a link under cursor, f (for follow, I guess) to ask which link to go, completion available (usual TAB for that).

Please note, that when started info(1) defaults to a proper Info documentation (if such exists), rather than manpages. If that is not what you want by some reason, you have to specify man section explicitly:

$ info 'mkdir(1)'     # that’s a man page

rather than:

$ info mkdir          # that’s a section in the full manual for Coreutils

__
¹ ESC + TAB if meta-tab (which might or might not be the same as Alt + TAB) does not work in your terminal.

Pablo Bianchi
  • 15,657
Dmitry Alexandrov
  • 1,578
  • 10
  • 12
0

There are programs that can be installed or configured which can natively follow such links, such as hacking vim, pinfo or w3mman.

There are many interesting ideas here: https://unix.stackexchange.com/questions/18151/how-to-follow-links-in-linux-man-pages

xeruf
  • 412