For quickly getting help on a Bash builtin, use help
:
help read
is what you want.
For man-page-like formatting, use
help -m read
or, even better,
help -m read | less
If you still insist on looking for it in the man page, I find what quickly gets me to a command's explanation is
/^\s*read [[]
This works because when a command is first explained, its name is indented slightly from the start of the line. In the particular case of read
, this takes a little browsing before you get to the actual read
documentation because (for obvious reasons) the word "read" is repeated a lot throughout the man page. The [[] means to match a [ which usually precedes optional parameters. (I usually leave out /^\s* and simply do /<built-in command> [[])
Another alternative
If you don't mind the format change, you can convert your man page to a DVI or PDF file:
man -T dvi bash >bash.dvi
or
man -T ps bash | ps2pdf - bash.pdf # Requires the Ghostscript suite for ps2pdf
Of course, given a DVI or PDF document, you can then do a text search easily.
Your image probably has the nodocs
transaction flag set in the yum configuration (cf. /etc/yum.conf
).
You can remove it globally (or at the yum command line) before (re-)installing the packages you want the man pages for.
For example:
yum --setopt=tsflags='' reinstall shadow-utils
Best Answer
That depends on the man pages... Traditionally, they have included a section with examples - but for some reason that is usually missing from the man pages under Linux (and I assume other using GNU commands - which are most these days). On for example Solaris on the other hand, almost every man page include the Example section, often with several examples.
If I were to guess, FSF/GNU has for a long time discouraged use of
man
pages and prefer users to use info for documentation instead.info
pages tend to be more comprehensive than man pages, and usually do include examples.info
pages are also more "topical" - i.e. related commands (eg. commands for finding files) can often be found together.Another reason may be that GNU and its
man
pages are used on many different operating systems which may differ from each other (there are after all lots of differences just between different Linux distros). The intention may have been that the publisher added examples relevant to the particular OS/distro - which obviously is rarely done.I would also add that
man
pages were never intended to "teach beginners". UNIX was developed by computer experts (old term "hackers") and intended to be used by computer experts. The man pages were thus not made to teach a novice, but to quickly assist a computer expert who needed a reminder for some obscure option or strange file format - and this is reflected in how a man page is sectioned.man
-pages are thus intended asman
pages - eg. for the format of config files and related/similar commands.That said, I very much agree with you that
man
pages ought to have examples, since they can explain the usage better than wading through the man page itself. Too bad examples generally aren't available on Linuxman
pages...Sample of the Example part of a Solaris man page - zfs(1M):
This particular man page comes with 16(!) such examples... Kudos to Solaris!
(And I'll admit I myself have mostly followed these examples, instead of reading the whole man page for this command...)