Searching in Manpage with Bash

Searching in Manpage with Bash

Post by Edward Wijay » Fri, 21 May 2004 09:41:11



Hi,

Is there a way to search a text within
a Manpage with bash?

Man itself doesn't seem to have any
particular command right?

Regards
Edward WIJAYA

 
 
 

Searching in Manpage with Bash

Post by Kevin Rodger » Fri, 21 May 2004 03:23:10


 > Is there a way to search a text within a Manpage with bash?
 >
 > Man itself doesn't seem to have any particular command right?

`man man` tells you this:

ENVIRONMENT VARIABLES
...
      PAGER     A program to use for interactively delivering  man
                's  output to the screen. If not set, `more -s' is
                used. See more(1).

And `man more` tells you this:

   Commands
...
      In the following commands, i is a numerical argument  (1  by
      default).
...
      in        Search for the ith occurrence of the last  pattern
                entered.
...
      i/pattern Search forward for the ith occurrence of the regu-
                lar  expression  pattern.  Display  the  screenful
                starting two lines before the line  that  contains
                the  ith match for the regular expression pattern,
                or the end of a pipe, whichever comes  first.   If
                more   is displaying a file and there is no match,
                its position in the file remains unchanged.  Regu-
                lar expressions can be edited using erase and kill
                characters.  Erasing back past  the  first  column
                cancels the search command.

--
Kevin Rodgers

 
 
 

Searching in Manpage with Bash

Post by Alan Conno » Fri, 21 May 2004 04:26:58



> Hi,

> Is there a way to search a text within
> a Manpage with bash?

> Man itself doesn't seem to have any
> particular command right?

Just hit "/" for forward searches and enter your search string. "?" for
backwards searches. "n" to repeat. Escape-u to clear the highlighted
strings from the screen. Up/Down arrows for search history.

This is when PAGER is set to less, which I highly recommend. It's the
best one and worth learning a bit about.

Man man; man less.

AC

 
 
 

Searching in Manpage with Bash

Post by Kevin Colli » Sat, 22 May 2004 01:03:04



> Hi,

> Is there a way to search a text within
> a Manpage with bash?

> Man itself doesn't seem to have any
> particular command right?

> Regards
> Edward WIJAYA

Others have already mentioned the man page for 'man' and using the '/' and '?'
search keys. Another good tip to know is to use:

man xyz - | col -b > xyz.txt

This will give you a plain-text copy of the manpage for 'xyz' in a text file.
You can then do what you like to search it.

Kevin

ps - I have noticed a high volume of posts from you in both this group and
comp.lang.perl.misc that could be solved by actually SEARCHING for an answer
and/or reading the FAQs and/or reading man pages (and perldocs). Use of
google.com and groups.google.com is highly recommended. While most folks don't
mind answering questions, after a while we get tired of seeing the same
questions repeated over and over again.

 
 
 

Searching in Manpage with Bash

Post by Dan Merce » Sat, 22 May 2004 03:36:04



: > Hi,
: >
: > Is there a way to search a text within
: > a Manpage with bash?
: >
: > Man itself doesn't seem to have any
: > particular command right?
: >
: > Regards
: > Edward WIJAYA
:
: Others have already mentioned the man page for 'man' and using the '/' and '?'
: search keys. Another good tip to know is to use:
:
: man xyz - | col -b > xyz.txt
:
: This will give you a plain-text copy of the manpage for 'xyz' in a text file.
: You can then do what you like to search it.
:
: Kevin

Let me put in a plug for PolyGlotMan (fka RosettaMan): http://polyglotman.sourceforge.net/
It's distributed along with tcl/tk (because it is the engine behind TkMan - IMHO the
best visual man reader).  The executable,  rman,  translates to various formats
including text.  Its text output is vastly superior to that produced using col because
it strips out extra blank lines and page breaks and other annoyances giving
you very clean output.  It can also produce HTML output and can be linked
to a web server to provide a hyper linked system (TkMan also acts as hypertext.)

You've got the link above.

Dan Mercer

:
: ps - I have noticed a high volume of posts from you in both this group and
: comp.lang.perl.misc that could be solved by actually SEARCHING for an answer
: and/or reading the FAQs and/or reading man pages (and perldocs). Use of
: google.com and groups.google.com is highly recommended. While most folks don't
: mind answering questions, after a while we get tired of seeing the same
: questions repeated over and over again.

 
 
 

Searching in Manpage with Bash

Post by Kevin Colli » Sat, 22 May 2004 13:24:47





>: > Hi,
>: >
>: > Is there a way to search a text within
>: > a Manpage with bash?
>: >
>: > Man itself doesn't seem to have any
>: > particular command right?
>: >
>: > Regards
>: > Edward WIJAYA
>:
>: Others have already mentioned the man page for 'man' and using the '/' and '?'
>: search keys. Another good tip to know is to use:
>:
>: man xyz - | col -b > xyz.txt
>:
>: This will give you a plain-text copy of the manpage for 'xyz' in a text file.
>: You can then do what you like to search it.
>:
>: Kevin

> Let me put in a plug for PolyGlotMan (fka RosettaMan): http://polyglotman.sourceforge.net/
> It's distributed along with tcl/tk (because it is the engine behind TkMan - IMHO the
> best visual man reader).  The executable,  rman,  translates to various formats
> including text.  Its text output is vastly superior to that produced using col because
> it strips out extra blank lines and page breaks and other annoyances giving
> you very clean output.  It can also produce HTML output and can be linked
> to a web server to provide a hyper linked system (TkMan also acts as hypertext.)

> You've got the link above.

Thanks, Dan. I can see that it is probably very useful. In most cases I just
search with the given PAGER, but I keep the 'col' trick at my disposal for
cases when I *know* something is in there but I just can't find it :) Then I'll
use vi/ grep, etc...

Quote:> Dan Mercer

-snip-

Kevin

 
 
 

1. BASH BASH BASH BASH BASH BASH BASH BASH BASH BASH

Is there a proper fixed bash on any of the FTP sites out there?

I know there bash is on the usual sites but I don't know if they are
bugged or not :(

Regards,

Neil.

--


------------------------------------| Edinburgh, EH14 2DE, United Kingdom
**Domino: There`s nothing you can do when you`re the next in line: Domino**

2. mail.local: authdes_refresh: keyserv(1m) is unable to encrypt session key

3. In search of Solaris 2.5 Netscape Navigator 3.0 plug ins

4. CDRW problem:

5. Search: Manpage for gated

6. More than 2 CPU`s for

7. WWW: Manpages-es Spanish Manpages Project

8. SURVEY: Ambrosia Software games for Linux?

9. Bashing bash (Was Re: bash or user error with set -e and subshells)

10. Bash calls TCL, TCL calls Bash, 2nd Bash never reads input

11. searching over the bash history

12. bash: edit incremental search lines, how?

13. changing BASH's path searching