# Asking the terminal for help

Course: Terminal Basics — https://zero2vibecode.com/learn/terminal-basics
Canonical URL: https://zero2vibecode.com/learn/terminal-basics/0-4-getting-help

You never have to memorise commands. `help` lists what exists and `man` explains one in detail — the terminal documents itself.

You do not have to remember any of this. The terminal documents itself, and looking things up is a normal part of using it — not a sign you have failed to learn it.

## help: what exists

Type `help` on its own and you get the list of commands available to you, each with one line explaining it:

```
Available commands:
  pwd      print the current folder
  ls       list files and folders
  cd       change folder
  ...
```

This is the answer to "I do not even know what to look for". Skim the list, spot something that sounds close to what you want, then go deeper.

You can also aim it at one command:

```
help ls
```

which gives you the one-line description plus an example.

## man: the full story on one command

`man` is short for **manual**. Give it a command name and it prints that command's proper documentation:

```
man ls
```

A manual page has a predictable shape, which makes it far less intimidating than it looks:

- **NAME** — the command and a one-line summary
- **USAGE** — the shape of the line, with optional parts in square brackets
- **DESCRIPTION** — what it does, and what each flag means

That USAGE line is the part beginners under-use. `ls [-a] [-l] [folder]` tells you at a glance that everything is optional: `ls` alone works, and `-a`, `-l` and a folder name are extras you may add.

Square brackets in a usage line mean "optional". They are notation, not something you type. `mkdir [-p] name` means the name is required and `-p` is your choice.

## Flags, briefly

Those `-a` and `-l` things are **flags** — small switches that change how a command behaves. They start with a dash and go before the arguments:

```
ls -a
```

The same command, asked to also show hidden files. You will meet flags constantly from here on, and the manual page is always where their meanings live.

When an AI agent proposes a command with a flag you do not recognise, `man` is the two-second check. `rm -r` and `rm -rf` differ by one letter and one of them ignores every safety complaint — the manual will tell you which.

## Try it

Run both, one after the other:

1. `help` — see everything available.
2. `man ls` — read the manual for one command in full.

Read the `ls` page properly rather than skimming. It is short, and it is the command you will use more than any other.
