π Linux/Unix: Manuals & Help Commands β man
, info
, and --help
Explained
π§² Introduction β Why Learn Linux Help Tools?
When you’re working in Linux, documentation is always at your fingertipsβright from the terminal. Whether you’re trying to understand a command’s options, troubleshoot syntax, or explore advanced usage, tools like man
, info
, and --help
offer instant guidance without needing to search online.
π― In this guide, youβll learn:
- How to use
man
to read command manuals - How to explore extended documentation with
info
- How to quickly check options using
--help
- Best practices for learning new commands efficiently
π 1. man
β The Manual Pages
β
What is man
?
man
(short for manual) displays the built-in documentation for nearly every command, configuration file, and library on a Unix/Linux system.
π οΈ Syntax:
man [command]
π§ͺ Example:
man ls
π€ Output:
Displays the manual page for ls
, including:
- Name and description
- Syntax and options
- Exit statuses
- Examples and notes
π Navigation Keys:
Key | Action |
---|---|
Space | Scroll forward |
b | Scroll back |
q | Quit manual page |
/pattern | Search for a pattern |
n/N | Repeat search forward/back |
πΉ Manual Sections:
Linux manuals are divided into numbered sections:
Section | Description |
---|---|
1 | User commands (e.g., ls , cat ) |
5 | File formats and config files |
8 | System administration commands |
To view a specific section:
man 5 passwd
π 2. info
β The GNU Info System
β
What is info
?
info
provides more detailed, hyperlinked manuals, often richer than man
. Itβs mostly used for GNU utilities.
π οΈ Syntax:
info [command]
π§ͺ Example:
info coreutils 'ls invocation'
π€ Output:
Shows a navigable menu structure with sections like Options, Usage, Examples, etc.
π Info Navigation Keys:
Key | Action |
---|---|
n | Next section |
p | Previous section |
u | Move up one level |
Space | Scroll forward |
q | Quit |
m | Return to the main menu |
π§ info
is useful for in-depth exploration when man
is too brief.
π§Ύ 3. --help
β Quick Command Reference
β
What is --help
?
The --help
option is supported by most commands and gives a quick summary of available flags and usageβgreat for a fast lookup.
π οΈ Syntax:
command --help
π§ͺ Examples:
ls --help
π€ Output (truncated):
Usage: ls [OPTION]... [FILE]...
List information about the FILEs (the current directory by default).
...
-a, --all do not ignore entries starting with .
-l use a long listing format
π§ Ideal for quick refreshers or script writers who donβt need full manuals.
π§ Tool Comparison Table
Tool | Purpose | Depth | Interactivity | Best Use Case |
---|---|---|---|---|
man | Full command manual | Medium | Scroll/search | Standard usage reference |
info | Hypertext GNU documentation | High | Menu-based | Detailed, structured exploration |
--help | Quick command-line summary | Low | Scroll only | Fast option reference |
π Summary β Recap & Next Steps
Linux makes it easy to learn as you go. With man
, info
, and --help
, you can understand commands, debug errors, and optimize scripts without leaving the terminal.
π Key Takeaways:
- Use
man
for standard command references and syntax. - Use
info
for GNU command deep-dives with navigable menus. - Use
--help
for quick flag lookups or reminders.
β FAQs
β How do I find which manual sections are available for a command?
β
Use:
man -f command
or
whatis command
β What if the man
page is missing?
β
Install the manual packages:
sudo apt install man-db
β How do I search for a commandβs man page by keyword?
β
Use:
man -k keyword
Example:
man -k network
β Whatβs the difference between man
and info
?
β
man
is brief and linear. info
is detailed, with hyperlinks and menus.
β How do I see all options of a command without reading the manual?
β
Use:
command --help
Share Now :