117-010 · Question #83
Which command line can be used to search help files that mention the word "copy"?
The correct answer is A. man -k copy. See the full explanation below for the reasoning.
Question
Which command line can be used to search help files that mention the word "copy"?
Options
- Aman -k copy
- Bwhatis copy
- Cman copy
- Dcopy help
- Ecopy --help
How the community answered
(23 responses)- A83% (19)
- B9% (2)
- C4% (1)
- D4% (1)
Community Discussion
4A is the one you want here. "man -k copy" does a keyword search across all man page descriptions, so it pulls up any command that mentions "copy" in its short description line. That is exactly what you need when you don't know the specific command name but you know what it does. The other options either require you to already know the command name (man copy, whatis copy, copy --help) or are just not valid Linux commands at all (copy help).
A is right. "man -k copy" does a keyword search across all man page descriptions, which is exactly what you want when you don't know the specific command name but remember what it does. The tricky one here is B, "whatis copy," because it also queries the man page database, but whatis only returns entries where "copy" is the exact command name, not a keyword mentioned somewhere in the description. C just opens the man page for a command literally named "copy," which probably doesn't exist, and D and E don't even make sense as real syntax in any standard Unix environment.
man -k is the keyword search; whatis only matches exact names, so A.
Hiroshi is right that whatis matches exact names, but worth noting man -k is literally just an alias for apropos, so they behave identically under the hood.