Question

The following command gives many manuals of Zsh

man zsh<tab>

alt text http://dl.getdropbox.com/u/175564/zsh.png

I would like to browse them fast to search the word compinit.

How can you search the word compinit fast in the manuals in Zsh?

Was it helpful?

Solution

Often for this kind of thing man -k compinit works, because authors are sensible enough to put lots of identifiers into the "short description" of the man page.

This doesn't seem to be the case here ... so you're going to have to grep through the source. Which is gzipped ...

zgrep -c compinit /usr/share/man/man1/zsh*

or if you don't have zgrep:

cd tmp
cp /usr/share/man/man1/zsh* .
gunzip zsh*.gz
grep -c compinit zsh*

There are more elegant ways to do this, but that gives you a list of how often compinit appears in each file:

zsh.1:0
zsh4.1:0
zshall.1:0
zshbuiltins.1:0
zshcalsys.1:0
zshcompctl.1:0
zshcompsys.1:29
zshcompwid.1:0
zshcontrib.1:0
zshexpn.1:0
zshmisc.1:0
zshmodules.1:1
zshoptions.1:0
zshparam.1:0
zshroadmap.1:0
zshtcpsys.1:0
zshzftpsys.1:0
zshzle.1:0

OTHER TIPS

Using the internet is probably the best way. The other approach is to use the zshall manpage, which contains all the manpages together. You can then search for compinit in whatever viewer you're using.

EDIT: I just remembered a better way of doing this: Use zsh's run-help function.

$> run-help compinit

This will take you to the manpage that zsh thinks is most appropriate for the topic. It also works for non-zsh related topics like ps, grep, etc, but has been adjusted to work for zsh topics as well.

If for some reason run-help isn't loaded, you can use

$> autoload run-help

to do so.

You could use the internet... all of the man pages are on it... just prefix your searches with

zsh man

(If you know where they are located on the harddrive... you might be able to grep them... I don't know as I have not ever needed to myself)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top