-   Linux - Newbie (
-   -   how to exit/quit man? (

Mountain 11-07-2007 06:27 PM

how to exit/quit man?
I'm not sure how to quit man. It seems like ":q" works... is that the way to do it?

where do I learn about the man "runtime" commands? "man man" doesn't discuss them.

pwc101 11-07-2007 06:31 PM

man uses a program called "less" to display the contents of the manpages. Thus, all commands for less are essentially commands for man. Useful ones are "/" which will allow you to search for words (scroll through the results with "n" and "N"), and "q", which allows you to exit the man page.

(run each of the commands above (/nNq) without the quotes! ;))

rickh 11-07-2007 06:35 PM

That question sure takes me back.

matthewg42 11-07-2007 06:40 PM

The man program typically uses the less pager program to view it's output. You can read the less manual page to discover the keys, or simply press h when viewing something in less to get quick help.

I said typically, because man actually checks the value of the environment variable PAGER, and if it is set, uses that as the program to view pages. A simpler, and older pager is called more which has rather minimal functionality. I don't recommend using it instead of less because it is not as useful, but just as an example of how to set a different pager program, you might do this:

export PAGER=more
man ls

...and that will use more to page through the file. It happens that q also quits from more. The name less is a play on the name more. It might not look like much, by less is really quite a nice program. Browse the help and discover some nice features.

Mountain 11-07-2007 06:49 PM

Thanks. Every little thing I learn helps.

All times are GMT -5. The time now is 02:13 PM.