Contents Lesson 3 of 21

7 min read · foundations

The terminal is a way to ask questions

By the end of this lesson you will have a folder for this course, made and entered from the terminal alone, with pwd confirming you are inside it.

The black window is not for experts. It is a place where you type the name of a thing and it happens — and it is how every tool in this track is run.

On Windows, open Git Bash first

The commands in this course (export, $VARIABLE, grep, sh, mv) are written for a shell called bash. The terminal VS Code opens on Windows by default is PowerShell, which does not know several of them. Git for Windows, which you installed in lesson 2, comes with Git Bash, so use that: in VS Code open Terminal, then New Terminal, click the small arrow beside the plus sign at the right of the terminal panel, and choose Git Bash (the profile selector). You can also set it as the default there. On a Mac or Linux the default terminal already works, and nothing here changes. Everything below is what bash prints.

Five commands are most of it

pwd          where am I
ls           what is here
cd folder    go into that folder
cd ..        go back up
mkdir name   make a folder called name

That is genuinely most of daily use. You are always somewhere — a folder — and commands act on where you are. Getting lost is the beginner's whole difficulty, and pwd answers it every time.

Tab is the important key

Start typing a folder name and press Tab. It completes. This is not a nicety: it means you never mistype a path, which removes an entire category of confusing error.

Reading what comes back

A command that worked usually says little or nothing. Silence is success. That feels wrong at first — you want a confirmation — but a tool that printed "done!" after every action would be unusable in a script.

A command that failed says so, at length. Three you will meet:

  • command not found — the program is not installed, or the terminal is stale.
  • No such file or directory — you are not where you think. Run pwd.
  • permission denied — the file is protected, or you are somewhere you should not be writing.

Ctrl-C stops things

Some commands keep running until told otherwise — a web server, for example, which you will start in unit 3. Ctrl-C ends it. Knowing that stops the specific panic of "the terminal won't let me type any more".

Why not just use the mouse

Because commands are repeatable and quotable. You can put one in a document, hand it to somebody, and it does the same thing on their machine. Every instruction in this academy is a command for exactly that reason, and it is also why an agent can help you: it can write a command and, from unit 5, run one in your terminal — but it cannot click your mouse.

Try it now

Make a folder for this course, move into it, and confirm with pwd that you are there. Then, from that folder, run ls in an empty directory and notice that it prints nothing at all. That nothing is your first correct output.

The prompt

Do the exercise first, then paste everything your terminal printed into your chat assistant:

I am learning the terminal. Below is everything it printed while I
made a folder and moved into it. Go through it line by line: which
command produced each line, and did that command succeed? If a
command printed nothing, say what that means. Do not give me new
commands to run.

[paste the whole terminal session]

A good answer reads the output of pwd as the path you are in, and calls the empty answer from ls a success rather than a problem.

Check it yourself

  1. pwd prints a path that ends with your folder's name.
  2. ls prints nothing at all, and the prompt comes straight back.
  3. cd .. then pwd: one level up. Type cd and the first two letters of your folder, press Tab, and the name completes. Press enter and you are back inside.
  4. Type node on its own. A > prompt appears and waits for JavaScript. Press Ctrl-C twice and your own prompt returns.

Break it on purpose

Run cd with a folder name that does not exist. Read the message: it names the folder it could not find. Then run pwd, and confirm you are still exactly where you were — a failed command moved you nowhere.

Compare with ours

Our session
$ mkdir eodhd-course
$ cd eodhd-course
$ pwd
/Users/you/eodhd-course
$ ls
$

Three of those commands printed nothing, and every one of them worked. In Git Bash on Windows the path starts with /c/Users instead, because Git Bash writes the C: drive as /c.

Checkpoint

Nothing to commit yet: the course folder you just made is where git init runs in the next lesson. Move SETUP.md and idea.txt into it now: mv ../SETUP.md ../idea.txt . if they sit one folder up, or drag them in from your file manager. ls then lists both. Then answer this lesson's questions.