3

man pages often look like a wall of text when you open them, with huge amounts of options and often not much context. But they are a great mine of information for how to use the commands.

So how do you go about making sense of man pages? What are the standard sections about? How are they organised? Is there a mental map that makes it easier to make sense of man?

Are there any tips you use to make them easier to navigate - eg adding colour to the text.

Hamish Downer
  • 9,142
  • 6
  • 36
  • 49
  • In addition to this page also see the [man info page](http://serverfault.com/questions/tagged?tagnames=man&sort=info). – Zoredache Aug 12 '10 at 18:25

4 Answers4

3

I don't view man pages as a source for primary learning. I view man pages as a useful trigger for reminding me how to do something I already know how to do.

Usually you can find tutorials or how-tos on the internet which teach how and why things go together the way they do. Then when you come to actually do it, you read the man pages to remind yourself of the particular flag or syntax of how to get it done. My personal rule of thumb is that if I can't figure out what I need to do in two passes of the man page, I need Google... and probably to create some notes for myself.

Usually I find that less is the best man page viewer for me; I can scroll up and down and do searches in it to find the words I am looking for.

David Mackintosh
  • 14,223
  • 6
  • 46
  • 77
2

The Description and Examples sections of man man are a great help in understanding how man pages are organized and how to use them.

In general, I find the Examples, See Also and Files sections of many man pages to be very useful since they give clues where to look next when you're trying to track down something that may be obscure.

If your pager is less you can set the LESS_TERMCAP_* variables to show color in man pages. Here are mine:

export LESS_TERMCAP_mb=$(tput bold; tput setaf 2) # green
export LESS_TERMCAP_md=$(tput bold; tput setaf 6) # cyan
export LESS_TERMCAP_me=$(tput sgr0)
export LESS_TERMCAP_so=$(tput bold; tput setaf 3; tput setab 4) # yellow on blue
export LESS_TERMCAP_se=$(tput rmso; tput sgr0)
export LESS_TERMCAP_us=$(tput smul; tput bold; tput setaf 7) # white
export LESS_TERMCAP_ue=$(tput rmul; tput sgr0)
export LESS_TERMCAP_mr=$(tput rev)
export LESS_TERMCAP_mh=$(tput dim)
export LESS_TERMCAP_ZN=$(tput ssubm)
export LESS_TERMCAP_ZV=$(tput rsubm)
export LESS_TERMCAP_ZO=$(tput ssupm)
export LESS_TERMCAP_ZW=$(tput rsupm)

Don't forget that the info files often have more detail and are navigable (have a form of hyperlink).

Dennis Williamson
  • 60,515
  • 14
  • 113
  • 148
  • +1 for "man man". For some reason, I never thought to invoke that when I was first learning my way around SunOS. – Skyhawk Aug 12 '10 at 16:37
1

If you are using konqueror then man pages can be browsed in the browser itself. Just put man:/command_name to view man page

e.g. man:/ls

Alternatively there's vim plugin available to view man pages with syntax highlighting in vim http://vim.wikia.com/wiki/View_man_pages_in_Vim

Abhishek A
  • 429
  • 5
  • 12
0

I browse them with vim and syntax highlighting