12. Finding Help: man Pages and Built-in Help
The most powerful documentation tool in Linux is the manual pages, or man pages.
1. Using the man Command
man provides detailed documentation on almost every command and system utility.
bash
View the manual page for the ls command
$ man ls
This will open the documentation in the less pager (allowing you to scroll). Pay attention to the SYNOPSIS (how to use the command) and DESCRIPTION sections.
Inside man:
- Press
SPACEto scroll down. - Press
Bto scroll up. - Press
/and type a keyword to search. - Press
Qto quit.
2. The --help Flag
Many commands provide a concise help summary using the --help flag. This is often faster than reading the full man page.
bash $ cp --help Usage: cp [OPTION]... SOURCE DEST or: cp [OPTION]... SOURCE... DIRECTORY ... (shows common options and arguments)
3. Searching for Commands (apropos)
If you know what you want to do but not the specific command name, apropos searches the short descriptions of all man pages.
bash
Search for commands related to 'network'
$ apropos network
Troubleshooting Tip
If running man gives an error, it usually means the man package itself needs to be installed, or the documentation for that specific utility is missing. Always ensure your core system is up to date.