how to make man page not disappear on exit

7

1

...probably a silly question but I could not beat google into telling me the answer so posting here:

I got 2 machines - Slackware 13 and Fedora 11.

On the slack machine, when I use man I can scroll all the way to the bottom then exit man and the info stays in my terminal window (which I find very convenient as I can read it while typing the command in question, copy-paste the options, etc.).

On fedora when I close man the man page info is gone.

How can I configure man (or is it the terminal?) to not remove the man page info on exit?

Alan

Posted 2011-01-03T07:46:17.677

Reputation:

Answers

12

man uses less to display the man page. It is less that is causing the behaviour you are seeing.

One way to get around this is to set the MANPAGER environment variable to something like less -X

e.g. try: MANPAGER="less -X" man less

Wodin

Posted 2011-01-03T07:46:17.677

Reputation: 253

1

The utility less, which is parsing your manpages in this case, uses the environment variable LESS. In your rc file (e.g. ".bashrc" if you're using the bash shell), set the LESS environment variable to "-X", which "Disables sending the termcap initialization and deinitialization strings to the terminal.", which in your case is unnecessariliy clearing the screen. In bash it looks like the following:

export LESS="-X"

waynesworld

Posted 2011-01-03T07:46:17.677

Reputation: 11

0

you can pipe the man page to cat. Try:

man man | cat

trex005

Posted 2011-01-03T07:46:17.677

Reputation: 181

This is also helpful as it leaves the info on the screen, but I like Wodin's solution better as it preserves the look and feel of man, i.e. you can scroll up and down and you can search the content with '/'. Anyway - thanks to both of you for providing these answers. – None – 2011-01-04T11:19:53.990