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.
There's no option for that in updatedb.conf
. You'll have to arrange to pass options to updatedb
manually.
With updatedb from GNU findutils, pass --localpaths
.
updatedb --localpaths '/ /media/win_c/somewhere/Music /media/win_c/somewhere/Photos'
With updatedb from mlocate, there doesn't appear a way to specify multiple roots or exclude a directory from pruning, so I think you're stuck with one database per directory. Set the environment variable LOCATE_PATH
to the list of databases:
updatedb --output ~/.media.mlocate.db --database-root /media/win_c/somewhere --prunepaths '/media/win_c/somewhere/Videos'
export LOCATE_PATH="$LOCATE_PATH:$HOME/.media.mlocate.db"
Best Answer
Just use shell wildcards in the locate's search pattern - that functionality is a historical feature of the utility and should be supported on all systems.
E.g.:
Be sure to use stars around the search string (or at least in front of it) as once you use wildcards
locate
switches the logic and anchors the search string to beginning and end of the searched material.