I can do for example
man cp | grep verbose
to findout if cp man has word "verbose", how can I do something like (pseudo-code)
man * | grep copy
to find out what command to use for coping?
You can use
man -K printf
(note the capital k) to search in content of man all man pages. The first page will be shown, and when you quit you have the option to open or skip the next matching page or quit the whole search.
man -k printf
Search the short descriptions and manual page names for the keyword printf as regular expression. Print out any matches. Equivalent to apropos -r printf.
Or as you can see you can also use
apropos -r printf
Example...
man -k "test"
Test (3perl) - provides a simple framework for writing test scripts cupstestdsc (1) - test conformance of postscript files cupstestppd (1) - test conformance of ppd files DBD::Gofer::Transport::null (3pm) - DBD::Gofer client transport for testing DBD::Gofer::Transport::pipeone (3pm) - DBD::Gofer client transport for testing dh_auto_test (1) - automatically runs a package's test suites dh_testdir (1) - test directory before building debian package dh_testroot (1) - ensure that a package is built as root dh_testversion (1) - ensure that the correct version of debhelper is installed ExtUtils::testlib (3perl) - add blib/* directories to @INC feature_test_macros (7) - feature test macros File::CheckTree (3perl) - run many filetest checks on a tree filetest (3perl) - Perl pragma to control the filetest permission operators ftm (7) - feature test macros gcov-4.2 (1) - coverage testing tool make-memtest86+-boot-floppy (1) - (unknown subject) Memoize::ExpireFile (3perl) - test for Memoize expiration semantics Memoize::ExpireTest (3perl) - test for Memoize expiration semantics mysql_client_test (1) - test client API mysql_client_test_embedded (1) - test client API for embedded server mysqlmanager-pwgen (1) - internal test-suite program mysqlmanagerc (1) - internal test-suite program mysqltest (1) - program to run test cases mysqltest_embedded (1) - program to run embedded test cases ndb_cpcd (1) - automate testing of NDB (development use only)
You can use
man -k copy
to search in the short descriptions and names of all manpages for copy
You can also zgrep -r
each location in manpath
to search the raw manpage files.
for p in $(manpath | tr ":" " ");
do
echo $p
zgrep -r 'copy' $p
done
manpath
is a command (it might also be a ENV, but I'm talking about the command) and b) good point, I'll swap it for zgrep
which works on both the compressed and non-compressed files.
manpath
as a command. Learn something new every day. But zgrep doesn't support -r, so try this: find $(manpath | tr ":" " ") -type f -print0 | xargs -0 zgrep 'copy'
Try this:
man * | col -b | grep *