Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
man has its own man page ;) – Rinzwind Nov 17 '11 at 15:40

You can use

  man -k copy

to search in the short descriptions and names of all manpages for copy

share|improve this answer
That solves the second part of the question. For the first part, there are a couple of options. 'man cp | cat | grep verbose' will just get the particular lines containing the word verbose. You can also type /verbose when you're in the man page to do a pattern match for the word 'verbose'. After that, if you keep pressing 'n', it will cycle you through all the occurences of the word verbose in the file. – ovangle Nov 17 '11 at 15:45
ovangle - that cat is superfluous. – ams Nov 17 '11 at 16:12
So it is. Stupid me, that's a whole 5 keystrokes I've wasted every time I've grepped a man page (never -- I prefer some context with my flags, so '/' is more useful). – ovangle Nov 17 '11 at 17:09

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


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)

share|improve this answer

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.

share|improve this answer

Try this:

man * | col -b | grep *
share|improve this answer

You can also zgrep -r each location in manpath to search the raw manpage files.

for p in $(manpath | tr ":" " ");
    echo $p
    zgrep -r 'copy' $p
share|improve this answer
Except that a) MANPATH is upper case and often not set, and b) many man-pages are compressed and therefore not grep-able. – ams Nov 17 '11 at 16:09
a) 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. – Oli Nov 17 '11 at 16:29
Ah, I did not know about 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' – ams Nov 17 '11 at 20:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.