Getting Help (You'll Never Memorize It All)
Getting Help
Scenario: It's your first week. Your senior hands you a command you've never seen and walks off. You don't panic - because a pro's real skill isn't memorizing 5,000 commands, it's knowing how to look things up fast.
| Command | What it gives you |
|---|---|
man ls | The manual - full reference for a command |
ls --help | Quick option summary (faster than man) |
apropos copy | Search man pages by keyword |
type cd | Is it a program, alias, or shell builtin? |
which ls | Where does this command live on disk? |
Inside a man page: arrow keys scroll, /word searches, n jumps to the next match, and q quits.
$ man wc # opens the manual (press q to quit)
$ wc --help | head -4
Usage: wc [OPTION]... [FILE]...
Print newline, word, and byte counts for each FILE
Tip: Stuck insidemanand can't get out? Pressq. (This is the second most-Googled Linux question - the first is coming up in the vim module.)
Reading a synopsis: [OPTION]... means options are optional and repeatable; FILE... means one or more files.