Linux CLI HowTo 10 🐧 Help and Man Commands
Linux CLI 10 – How-to Help and Man Commands
1. How to Display Built-in Command Help in Bash
Steps:
- Open terminal
- Type
helpfollowed by command name - Example:
help cd - Press Enter to see detailed help information
- Use
help -d cdfor brief description only - Use
help -s cdfor synopsis only
2. How to View Command Help Using –help Option
Steps:
- Open terminal
- Type command followed by
--help - Example:
cp --help - Press Enter to see help information
- For paginated output:
cp --help | less - Use arrow keys or spacebar to navigate through help text
3. How to Display Manual Pages for Commands
Steps:
- Open terminal
- Type
manfollowed by command name - Example:
man ls - Press Enter to view detailed manual page
- Use keyboard shortcuts to navigate:
- Spacebar: move one screen forward
- b: move one screen backward
- q: quit manual viewer
4. How to View Specific Manual Sections
Steps:
- Open terminal
- Type
manfollowed by section number and command - Example:
man 2 mkdir - Press Enter to view section 2 documentation for mkdir
- Use section numbers 1-9 depending on type of documentation needed
5. How to Find Command Descriptions with man -f
Steps:
- Open terminal
- Type
man -ffollowed by command name - Example:
man -f mkdir - Press Enter to see brief description of the command
- This is useful for quickly identifying what a command does
6. How to Find Manual Page Locations with man -w
Steps:
- Open terminal
- Type
man -wfollowed by command name - Example:
man -w mkdir - Press Enter to see file path where manual page is stored
- This shows you exactly where the documentation files are located
7. How to Search Through Manual Pages
Steps:
- Open terminal and type
man ls - Press Enter to view manual page
- While in manual page, press
/followed by search term - Example:
/optionsto find all occurrences of “options” - Press
nto go to next search result - Press
Nto go to previous search result
8. How to Display All Manual Pages for a Command
Steps:
- Open terminal
- Type
man -afollowed by command name - Example:
man -a write - Press Enter to see all sections for the write command
- Use keyboard shortcuts to navigate between sections
- Press
hto display help and available shortcuts
9. How to Get Quick Command Information with help
Steps:
- Open terminal
- Type
helpfollowed by command name - Example:
help cp - Press Enter to see built-in command information
- Compare with
man cpfor more detailed documentation - Use
help -sfor concise synopsis format
10. How to Navigate Man Pages Effectively
Steps:
- Open terminal and type
man command - Press Enter to view manual page
- Use these navigation shortcuts:
- Spacebar or f: forward one screen
- b: backward one screen
- d: forward half a screen
- u: backward half a screen
- /search_term: search for text
- n: next match
- N: previous match
- h: show help and all shortcuts
- q: quit manual viewer
11. How to Use Man Pages with Paged Output
Steps:
- Open terminal
- Type
man command | lessorman command | more - Press Enter to view manual page in pager
- Use spacebar to advance through pages
- Use
qto quit when finished - This is useful for long manual pages that don’t fit on screen
12. How to Find Documentation in Specific Sections
Steps:
- Open terminal
- Type
man -f commandto find which sections contain documentation - Example:
man -f ls - Then use
man section_number commandfor specific section - Example:
man 1 lsfor user commands,man 2 lsfor system calls