help
Overview
The help
command displays information about shell (bash) built-in commands. It provides quick reference documentation for commands that are part of the shell itself.
Syntax
help [-dms] [pattern ...]
Common Options
Option | Description |
---|---|
-d |
Output short description |
-m |
Display usage in pseudo-manpage format |
-s |
Output only brief syntax |
-i |
Output detailed information |
pattern |
Show help for commands matching pattern |
Key Use Cases
- Get help on shell builtins
- Check command syntax
- View command options
- Learn about shell features
- Quick reference guide
Examples with Explanations
Example 1: Basic Help
help cd
Show help for cd builtin command
Example 2: Brief Syntax
help -s read
Show only syntax for read command
Example 3: Detailed Information
help -i test
Show detailed information about test command
Understanding Output
Help output includes: - Command syntax - Description - Options - Arguments - Examples - Related commands
Common Usage Patterns
List all builtins:
help
Get command syntax:
help -s command
Search for command:
help command | grep keyword
Performance Analysis
- Instant access to documentation
- No external files needed
- Shell-specific information
- Memory efficient
- Always available