help

system managementlinux
The help command is one of the most frequently used commands in Linux/Unix-like operating systems. help The help command displays information about built-in shell commands. It provides a quick way to access documentation on bash shell commands directly from the terminal, showing their purpose, syntax, and available options.

Quick Reference

Command Name:

help

Category:

system management

Platform:

linux

Basic Usage:

help [options] [arguments]

Common Use Cases

  • 1

    Command help

    Display help information for a command

  • 2

    Quick reference

    Get a brief overview of command usage

  • 3

    Learning

    Learn about new commands and utilities

  • 4

    Scripting

    Use in shell scripts to dynamically retrieve command help

Syntax

help [PATTERN...]

Options

Option Description
-d Output short descriptions for each topic
-m Display usage in man page format
-s Output only a short usage synopsis for each topic

Examples

How to Use These Examples

The examples below show common ways to use the help command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.

Basic Examples:

help

Display a list of all available shell builtin commands.

help cd

Show detailed help information for the cd builtin command.

help for

Display documentation for the for loop syntax in bash.

Advanced Examples:

help -d

Output a short description for each shell builtin command.

help -m if

Display the help information for the if command in man page format.

help -s read

Show a shorter, more concise usage syntax for the read command.

help c*

Show help for all builtin commands that start with the letter 'c'.

Try It Yourself

Practice makes perfect! The best way to learn is by trying these examples on your own system with real files.

Understanding Syntax

Pay attention to the syntax coloring: commands, options, and file paths are highlighted differently.

Notes

Key Points:

  • The help command only provides information about bash shell builtin commands
  • For external commands, use man, info, or whatis instead
  • The command can be used with wildcards to show help for multiple commands at once
  • Help pages are generally more concise than full manual pages
  • The output format varies based on the terminal width

Bash Builtins:

  • The help command works with bash builtin commands including:
  • cd, pwd, echo, alias, bg, fg
  • source, type, set, unset, export
  • if, for, while, until, case
  • read, declare, eval, exec, exit

Common Use Cases:

  • Quickly check the syntax of bash control structures
  • Get help on shell builtin commands without leaving the terminal
  • Learn about shell variables and parameter expansions
  • Understand job control and process management commands
  • Remind yourself of command options for shell builtins

Related Commands:

  • man - Display manual pages for commands and files
  • info - Read Info documents
  • whatis - Display short descriptions from manual pages
  • apropos - Search manual page names and descriptions
  • type - Display information about command type

Environment Variables:

  • PAGER: Specifies the program used to display output
  • MANPAGER: When using -m option, specifies the pager to use
  • COLUMNS: Determines the width used for formatting the output

Tips & Tricks

1

Use the -m module option to display help for a specific module

2

Use the -s section option to display help for a specific section

3

Use the -h option to display help

4

Use the -v option to display version information

5

Use the -d option to display debugging information

Common Use Cases

Command help

Display help information for a command

Quick reference

Get a brief overview of command usage

Learning

Learn about new commands and utilities

Scripting

Use in shell scripts to dynamically retrieve command help

Documentation

Access basic documentation for installed software

Related Commands

These commands are frequently used alongside help or serve similar purposes:

Use Cases

1

Command help

Display help information for a command

2

Quick reference

Get a brief overview of command usage

3

Learning

Learn about new commands and utilities

4

Scripting

Use in shell scripts to dynamically retrieve command help

5

Documentation

Access basic documentation for installed software

Learn By Doing

The best way to learn Linux commands is by practicing. Try out these examples in your terminal to build muscle memory and understand how the help command works in different scenarios.

$ help
View All Commands