man man shows you what the
-k switch does to
Using the -k switch
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.
apropos mentioned above, searches through index files, looking at both the names of the man pages as well as a short description of each.
Each manual page has a short description available within it.
apropos searches the descriptions for instances of keyword.
You can compare the 2 commands output, to convince yourself that they're doing the same things like so:
$ diff <(man -k printf) <(apropos -r printf)
Doing just a
man xyz will search for a man page in the locations defined when you do a
$ man -w
So when I type
man xyz the
man command will search through those directories, looking for a man page that corresponds to
man xyz is looking for man pages that correspond to the name
man -k xyz is looking for the string, "xyz" in both the names of the man pages along with the short description for each man page.
man manand checking out what