Home » Questions » Computers [ Ask a new question ]

How can I make the man command not use a pager?

How can I make the man command not use a pager?

How can I force the man command to not use a pager, and instead output the whole manpage at once and keep all highlighting?

Asked by: Guest | Views: 278
Total answers/comments: 2
bert [Entry]

"Long reading of manuals for man, less, groff and grotty finally gave me answer

Highlighting by default is made using backspace sequences: c\bc => bold c, _\bc => underlined c. But if output as is using cat as pager just outputs plain c in both cases. Also blank lines are squeezed, so to do all this, pager must be set to ul | cat -s.

Pager can be set in many ways:

using MANPAGER or PAGER variables (MANPAGER is better as PAGER affects not only man command)

export MANPAGER='ul | cat -s'

in man.conf

PAGER ul | cat -s

using -P parameter

cat -P 'ul | cat -s' …

or

alias man='man -P ""ul | cat -s""'"
bert [Entry]

"Alternatively, there's always the -P switch:

man -P cat foo"