Bash Wiki
Posts (Latest 30 updated) :
Read all
Contents:
  1. [Linux] Bash man uso: Access manual pages for commands
    1. Overview
    2. Usage
    3. Common Options
    4. Common Examples
    5. Tips

[Linux] Bash man uso: Access manual pages for commands

Overview

The man command in Bash is used to display the user manual of any command that is available on the system. It provides detailed information about the command’s usage, options, and examples, making it an essential tool for users looking to understand how to use various commands effectively.

Usage

The basic syntax of the man command is as follows:

man [options] [arguments]

Here, [arguments] typically refers to the command or topic you want to learn more about.

Common Options

  • -k: Search the manual page names and descriptions for a keyword.
  • -f: Display a short description of the command (similar to whatis).
  • -a: Show all manual pages for a command, if multiple exist.
  • -l: Display a manual page from a file instead of the system’s manual.

Common Examples

Here are several practical examples of using the man command:

  1. View the manual for the ls command:
    man ls
    
  2. Search for a keyword in the manual pages:
    man -k copy
    
  3. Display a short description of the cp command:
    man -f cp
    
  4. View all manual pages for the printf command:
    man -a printf
    
  5. Read a manual page from a specific file:
    man -l /path/to/manual_page.1
    

Tips

  • Use the q key to exit the manual page viewer.
  • You can scroll through the manual using the arrow keys or Page Up and Page Down.
  • If you find a command you frequently use, consider creating a personal cheat sheet based on the information from its manual page for quick reference.