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 cdShow help for cd builtin command
Example 2: Brief Syntax
help -s readShow only syntax for read command
Example 3: Detailed Information
help -i testShow detailed information about test command
Understanding Output
Help output includes: - Command syntax - Description - Options - Arguments - Examples - Related commands
Common Usage Patterns
List all builtins:
helpGet command syntax:
help -s commandSearch for command:
help command | grep keyword
Performance Analysis
- Instant access to documentation
- No external files needed
- Shell-specific information
- Memory efficient
- Always available