So we use man whatever
to get usage and other info regarding the whatever
command, when the relevant section of info is found, I'd like to quit the man
command with the info left on screen. So I can type the next command with the referee above. But the man
command quits the whole screen to recover the old screen similar to vim
.
Is there a way to achieve this?
I've been trying to grab the output of man pages and use it in some other things. That's working OK, but linux is hyphenating the words that are at the end of a line and that's kind of irritating because when the text is reconstructed on a variable width viewing window (think HTML), the line breaks reamin split- ting up ran- dom words.
How should I do this? I saw the entry regarding MANWIDTH but I can't get it to work...
I tried:
MANWIDTH=30 man ls -- also -- MANWIDTH=1000 man ls
No luck. I tried creating a man.conf that had MANWIDTH 30
(no "=" sign) and putting it in ~ and then tried:
man -C ~/man.conf ls
Man opens and it give me something like this:
^H1/4[{sUEy;o)||1XEQ'eo2>>vYYR%+-B _ _ AUe X...-qe>uyo{R2}Ia\fzuyv?>Oy|3+aaOGN+->ynuuLu{Ey3/4aecSYI~3[=5KVc]aem|6ME=ei2E, >>Z-:-OT3p<<cMnUA]ColXa+-No?6 AzQakmoEyo32HaeUoEaIxfSc;@S3[&%VDaODO(C)3O}I3 $2z-II9|D5S'VIo.m-PEA9|?'YXi4eZcy}R(R)t^oyu9|d0e<N8t4a3/41A:) oMNb"ao"OOu>EDaD&E`haUooEiw;f1C.bU-C KpAyb^92uE o2LKAe N}2OFSFi~MAO QA9|xT@k1/4zy$l'eAAy']CC/>>K^%T*LmI~An&qu ot;o1/2i2(R)141L,Z o.LXniE$~R6.a5O#AEUA14UiFwY~xIpB8<<JOo(R)QoMAEnUxu$Iw&Cj3eO fBLJ[Q^Xi-:->>(R)Eo2pm1c, _3ii<<EsCa;
So how do I get rid of those hyphenated words in the mid- dle of my man output?
I've set a filetype in vim for this. I want the help program to be man
. Of course this does not work. For instance, with ssh_config
's manpage, if I am on a word, say ServerAliveCountMax
,
I get an error, since there is no man pager for ServerAliveCountMax
-- it's inside ssh_config
's manpage.
From the command line, is there any way to jump to a string or run some type of command inside man
? Just like how info
can take me to the Miscellaneous
section of screen
's info page:
info screen Miscellaneous
Is this possible with man
? Even running a search would serve...
For OSX/*BSD with /usr/bin/man
, this works:
man -P 'less -p PATTERN' ssh_config
man pages often look like a wall of text when you open them, with huge amounts of options and often not much context. But they are a great mine of information for how to use the commands.
So how do you go about making sense of man pages? What are the standard sections about? How are they organised? Is there a mental map that makes it easier to make sense of man?
Are there any tips you use to make them easier to navigate - eg adding colour to the text.
I was invited to re-post this question with less opinion, so if it seems familiar, that's why.
How can I convert info pages into man pages? I used to have a shell one liner that flattened an entire info document into a single flat page, suitable for navigating with less, but I seem to have lost it. Please share if you know how to do this. :)
Thanks!