10

man defaults to using a pager. For short pages, I want to just echo them to the terminal without paging. I'm on OS X. Things I've tried:

man -t man                  #produces PostScript output
man man | groff -T latin1   #readable, but line wraps badly
man man | troff -a          #readable, but ... interesting ...
man man | echo              #no output

Better offers?

3 Answers3

9

You won't get formatting, but you can set the pager to be simply cat:

man man -P cat

Also, man won't format when piped, which is why the following gets you the same result:

man man | cat
Arjan
  • 31,511
5

To expand on on Arjan's Answer, you can get formatting using cat as a pager if you pipe it to ul:

man foo -P cat | ul
3

I fact I went a different route because I realised my 'real problem' was with less clearing the screen on exit. I put

export MANPAGER='/usr/bin/less -isXF'

in my startup profile. The -X parameter means that when I quit less, whatever part of the man page was on screen, stays there.