🔹 Why Help is Important
-
Linux has hundreds of commands, each with many options.
-
Even experts can't remember everything.
-
Linux provides built-in help systems for commands.
🔹 man – Manual Pages
📖 What is a man page?
-
Short for manual.
-
Contains documentation of a command/program.
🧠 Usage:
man <command>
- Example:
man ls
📚 Man Page Structure:
Section | Description |
|---|---|
Name | Command name and short description |
Synopsis | Syntax of command usage (options/arguments) |
Description | Detailed explanation of command |
Options | Explanation of available flags |
See Also | Related commands or references |
✅ Text conventions:
Bold → type as shown.
Italic/Underline → replace with a real value.
🔹 Navigating man Pages
Key | Action |
|---|---|
| Quit |
| Show help (less viewer) |
↑ / ↓ | Scroll up/down |
| Scroll forward one screen |
| Scroll backward one screen |
| Go to beginning |
| Go to end |
| Search forward for "term" |
| Search backward for "term" |
| Next search result |
| Previous search result |
Example: Searching in man ls
bashCopyEditman ls
-
Press
/sort→ highlights all matches for "sort" -
Use
nandNto navigate matches
🔹 Shell Built-in vs Executable Commands
Command Type | Example | Has | Use |
|---|---|---|---|
Executable |
| ✅ Yes | ❌ No |
Shell Built-in |
| ❌ No | ✅ Yes |
✅ Check command type:
type <command>
type ls # → shows path (executable)
type cd # → shows "shell builtin"
🔹 Help for Built-in Commands
help <command>
- Example:
help cd
🔹 Help for Executables
<command> --help
-
Works for both types (if supported)
-
Examples:
ls --help cd --help rm --help
🔹 Extra: ifconfig Command
-
Displays and configures network interfaces
-
Might not be pre-installed:
💡 Install net-tools:
- Ubuntu/Debian:
sudo apt install net-tools
- CentOS/RHEL:
sudo dnf install net-tools
🔹 man -k and apropos
🔎 Search man pages for keywords:
man -k <keyword>
apropos <keyword>
- Examples:
man -k ifconfig
man -k "copy files"
apropos uname
📌 Both commands show a list of related man pages.
✅ Summary
-
Use
manfor detailed documentation. -
Use
helpfor shell built-ins. -
Use
--helpfor quick command options. -
Use
typeto identify command type. -
Use
man -koraproposto search commands by keyword. -
Learn to navigate man pages efficiently with
less.