show man pages in terminal without a pager

1

1

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?

Chris F Carroll

Posted 2015-09-12T12:34:10.797

Reputation: 239

you can try setting MANPAGER= (ie empty) in the env. – meuh – 2015-09-12T13:38:36.010

At least on OS X that results in an error message when you try to man something – Chris F Carroll – 2015-09-12T15:38:48.437

sorry, dont have an OS X to try it on. Perhaps MANPAGER=cat ? – meuh – 2015-09-12T15:41:36.763

Yes, that worked. For my needs though, Arjan's answer is good. – Chris F Carroll – 2015-09-12T15:49:26.247

Answers

1

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

Posted 2015-09-12T12:34:10.797

Reputation: 29 084

Perfect, dankuwel! – Chris F Carroll – 2015-09-12T15:36:30.433

2

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

bowmasters

Posted 2015-09-12T12:34:10.797

Reputation: 115