KandZ – Tuts

We like to help…!

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:

  1. Open terminal
  2. Type help followed by command name
  3. Example: help cd
  4. Press Enter to see detailed help information
  5. Use help -d cd for brief description only
  6. Use help -s cd for synopsis only

2. How to View Command Help Using –help Option

Steps:

  1. Open terminal
  2. Type command followed by --help
  3. Example: cp --help
  4. Press Enter to see help information
  5. For paginated output: cp --help | less
  6. Use arrow keys or spacebar to navigate through help text

3. How to Display Manual Pages for Commands

Steps:

  1. Open terminal
  2. Type man followed by command name
  3. Example: man ls
  4. Press Enter to view detailed manual page
  5. 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:

  1. Open terminal
  2. Type man followed by section number and command
  3. Example: man 2 mkdir
  4. Press Enter to view section 2 documentation for mkdir
  5. Use section numbers 1-9 depending on type of documentation needed

5. How to Find Command Descriptions with man -f

Steps:

  1. Open terminal
  2. Type man -f followed by command name
  3. Example: man -f mkdir
  4. Press Enter to see brief description of the command
  5. This is useful for quickly identifying what a command does

6. How to Find Manual Page Locations with man -w

Steps:

  1. Open terminal
  2. Type man -w followed by command name
  3. Example: man -w mkdir
  4. Press Enter to see file path where manual page is stored
  5. This shows you exactly where the documentation files are located

7. How to Search Through Manual Pages

Steps:

  1. Open terminal and type man ls
  2. Press Enter to view manual page
  3. While in manual page, press / followed by search term
  4. Example: /options to find all occurrences of “options”
  5. Press n to go to next search result
  6. Press N to go to previous search result

8. How to Display All Manual Pages for a Command

Steps:

  1. Open terminal
  2. Type man -a followed by command name
  3. Example: man -a write
  4. Press Enter to see all sections for the write command
  5. Use keyboard shortcuts to navigate between sections
  6. Press h to display help and available shortcuts

9. How to Get Quick Command Information with help

Steps:

  1. Open terminal
  2. Type help followed by command name
  3. Example: help cp
  4. Press Enter to see built-in command information
  5. Compare with man cp for more detailed documentation
  6. Use help -s for concise synopsis format

10. How to Navigate Man Pages Effectively

Steps:

  1. Open terminal and type man command
  2. Press Enter to view manual page
  3. 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:

  1. Open terminal
  2. Type man command | less or man command | more
  3. Press Enter to view manual page in pager
  4. Use spacebar to advance through pages
  5. Use q to quit when finished
  6. This is useful for long manual pages that don’t fit on screen

12. How to Find Documentation in Specific Sections

Steps:

  1. Open terminal
  2. Type man -f command to find which sections contain documentation
  3. Example: man -f ls
  4. Then use man section_number command for specific section
  5. Example: man 1 ls for user commands, man 2 ls for system calls

Leave a Reply