man
The man command is used to view the manual pages of commands and programs.
Example:
man lsThis shows the full manual for the ls command.
Difference between man -f and man -k
| Command | Function | Equivalent To |
|---|---|---|
man -f | Shows a brief description of a command | whatis |
man -k | Searches manual page names and descriptions for a keyword | apropos |
man -f <command>
- Provides a one-line summary for the given command name.
- Only matches exact command names.
- Useful when you want to quickly check what a command does.
Example:
man -f cpOutput:
cp (1) - copy files and directoriesman -k <keyword>
- Searches through all manual pages for the keyword in names or descriptions.
- Can return multiple results if the keyword appears in many places.
- Useful for discovering commands related to a topic.
Example:
man -k copyOutput:
cp (1) - copy files and directories
install (1) - copy files and set attributes
scp (1) - secure copy (remote file copy program)Summary
| Command | Searches for | Output Type | Use Case |
|---|---|---|---|
man | Specific command | Full manual page | Learn how to use a command |
man -f | Exact command name | One-line summary | Quickly check what a command does |
man -k | Keyword in all man pages | List of matches | Find commands related to a keyword |
Last updated on