Getting Help

Here's a secret: nobody memorizes all the commands and their options.

Not even people who've used Linux for decades. The difference between a beginner and an expert isn't memorization - it's knowing how to find answers quickly.

The --help Flag

Almost every command supports --help:

Terminal
$ls --help
Usage: ls [OPTION]... [FILE]... List information about the FILEs. -a, --all do not ignore entries starting with . -l use a long listing format ...

This gives you a quick summary of what the command does and its most common options.

Quick Reference

When you just need a reminder of the flags, --help is faster than man pages.

man - The Manual Pages

For detailed documentation, use man (manual):

Terminal
$man ls
(opens the manual page for ls)

This opens a full documentation page. Navigate with:

  • Arrow keys or j/k to scroll
  • Space to page down
  • b to page back
  • / to search (then Enter)
  • q to quit

Man Pages Can Be Dense

Man pages are comprehensive but not always beginner-friendly. If you're confused, that's normal. Use them as reference, not tutorials.

man Page Sections

Man pages are organized into sections:

SectionContent
1User commands
2System calls
3Library functions
4Device files
5File formats
6Games
7Miscellaneous
8System admin commands

Usually you just run man command, but sometimes you need to specify the section:

hljs bash
man 1 printf    # The printf command
man 3 printf    # The printf C function

tldr - Too Long; Didn't Read

Man pages are thorough, but sometimes you just want examples. Enter tldr:

Terminal
$tldr tar
tar Archiving utility. Create an archive: tar cf archive.tar file1 file2 Extract an archive: tar xf archive.tar Create a gzipped archive: tar czf archive.tar.gz file1 file2

tldr gives you practical examples, not documentation. It's community-maintained and covers most common use cases.

Installing tldr

tldr might not be installed by default. Install it with sudo apt install tldr (Debian/Ubuntu), brew install tldr (Mac), or npm install -g tldr.

Online Resources

Sometimes the best help isn't on your machine:

cheat.sh - Community-driven cheat sheets right in your terminal:

hljs bash
curl cheat.sh/tar
curl cheat.sh/find

explainshell.com - Paste any command and it breaks down every part visually. Perfect for understanding complex commands you find online.

Don't Copy-Paste Blindly

Before running any command you find online, use explainshell.com to understand what it does. Never run something you don't understand, especially if it involves sudo or rm.

apropos - Search for Commands

Don't know which command to use? Search by keyword:

Terminal
$apropos directory
chdir (2) - change working directory chroot (8) - change root directory getcwd (3) - get current working directory ls (1) - list directory contents mkdir (1) - make directories pwd (1) - print working directory rmdir (1) - remove empty directories

This searches all man pages for the keyword. Super useful when you know what you want to do but not the command name.

whatis - Quick Description

Get a one-line description of a command:

Terminal
$whatis ls
ls (1) - list directory contents
$whatis grep
grep (1) - print lines that match patterns
$whatis chmod
chmod (1) - change file mode bits

type - What Kind of Command Is This?

Some commands are shell built-ins, some are external programs:

Terminal
$type cd
cd is a shell builtin
$type ls
ls is /usr/bin/ls
$type echo
echo is a shell builtin

This matters sometimes when troubleshooting path issues or when a command behaves unexpectedly.

which - Find Command Location

Find where a command lives:

Terminal
$which python3
/usr/bin/python3
$which node
/usr/bin/node

Useful when you have multiple versions installed and need to know which one you're running.

The Help Hierarchy

When you need help, try in this order:

  1. command --help - Quick syntax reminder
  2. tldr command - Practical examples
  3. curl cheat.sh/command - Online cheat sheet
  4. man command - Full documentation
  5. apropos keyword - Find the right command
  6. explainshell.com - Understand complex commands
  7. Web search - Last resort

Quick Reference

CommandWhat It Does
command --helpShow brief help
man commandShow full manual
tldr commandShow practical examples
apropos keywordSearch for commands
whatis commandOne-line description
type commandShow command type
which commandShow command location
Knowledge Check

Which command gives you practical examples rather than full documentation?

Key Takeaways

  • Use --help for quick syntax reminders
  • Use tldr for practical examples (install it if needed)
  • Use man for comprehensive documentation
  • Use apropos to find commands by keyword
  • Nobody memorizes everything - knowing how to find help is the real skill

Congratulations! You've completed Chapter 1. You now understand what the terminal is, why Linux matters, and how to help yourself when stuck.

Next chapter: we dive into the file system. Time to learn how to navigate like a pro.