Skip to content

3.1 Meet the Terminal

The terminal has a reputation problem. Movies made it the hacker's weapon; bad tutorials made it a hazing ritual. The truth is friendlier: it's a text conversation with your computer. You type a request, the computer answers. You already know how to have text conversations — you're just adding one more contact.

What you will learn

  • Read the prompt and understand what the terminal is telling you.
  • Run the six commands that cover most daily terminal life.
  • Recover calmly from the classic beginner stumbles.

Builder principle

Confidence in the terminal isn't knowing every command. It's knowing you can't easily break anything with the read-only ones — so explore freely.

The conversation

Open your terminal. A Bash-style prompt may look like:

jordan@macbook ~ %

That's the prompt — the computer saying "your move." It shows who you are (jordan), which machine (macbook), and where you're standing (~, your home folder). The % or $ means "type here." Windows PowerShell usually shows a prompt such as PS C:\Users\Jordan> instead; PS names the shell and the path says where you are.

You type a command, press ++enter++, the computer does it and answers. That's the whole interaction model. Everything else is vocabulary.

The six commands

Run each of these right now — reading about the terminal without typing is like learning to swim by email. The lesson names the common Bash commands; use the PowerShell equivalent in the right column on native Windows.

Intent Mac, Linux, or WSL Windows PowerShell 5.1
Show current folder pwd Get-Location
List names ls Get-ChildItem -Name
Change folder cd builds Set-Location .\builds
Create folder mkdir hello-terminal New-Item -ItemType Directory -Path .\hello-terminal
Read a text file cat notes.txt Get-Content .\notes.txt
Write a text file echo "I was here" > notes.txt Set-Content -Path .\notes.txt -Value "I was here"

1. pwd — where am I? (print working directory)

$ pwd
/Users/jordan

2. ls — what's here? (list)

$ ls
Desktop    Documents    Downloads    builds

3. cd — go somewhere (change directory)

$ cd builds
$ pwd
/Users/jordan/builds

cd .. steps back one level. In Bash, cd ~ (or just cd) takes you home from anywhere. In PowerShell, use Set-Location $HOME. Lost? Return home and start fresh.

4. mkdir — make a folder

$ mkdir hello-terminal

5. cat — show me a file's contents

$ cat notes.txt

6. echo with > — put text in a file

$ echo "I was here" > notes.txt
$ cat notes.txt
I was here

That's the core set. pwd, ls, and cat (or their PowerShell equivalents) only inspect state. cd changes your terminal's current location but does not edit files. Lean on those inspection commands while you orient yourself.

Quality-of-life moves

  • Tab completion: type the first letters of a file or folder, press ++tab++, the terminal finishes it. Use this constantly — it prevents typos and proves the thing exists.
  • History: press the ++arrow-up++ key to recall previous commands. Nobody retypes.
  • clear (or ++ctrl+l++): wipes the screen. Cosmetic, but calming.
  • ++ctrl+c++: cancels a running command. Your emergency brake — remember it.

When it goes weird

What you see What it means What to do
command not found Typo, or the program isn't installed Check spelling; check Setup
No such file or directory or Cannot find path The path doesn't exist from where you're standing Run pwd then ls, or Get-Location then Get-ChildItem -Name
Permission denied or Access is denied Your account cannot perform that action there Stop; return to your builds folder and confirm the intended path
Nothing at all happened Many commands succeed silently Silence is success. Verify with ls or cat
Screen hijacked by a text UI You've opened a pager — a scrollable viewer Press q to quit. (Everyone panics once. You're now inoculated.)

Try it now

The full circuit, from anywhere:

$ cd ~/builds
$ mkdir terminal-drill
$ cd terminal-drill
$ echo "day one in the command center" > log.txt
$ cat log.txt
$ ls
$ pwd
Set-Location (Join-Path $HOME "builds")
New-Item -ItemType Directory -Force -Path .\terminal-drill
Set-Location .\terminal-drill
Set-Content -Path .\log.txt -Value "day one in the command center"
Get-Content .\log.txt
Get-ChildItem -Name
Get-Location

Then do it again tomorrow without looking at this page. That's the two weeks of light practice starting — five minutes a day beats one heroic hour.

Check your understanding

  • Which three commands only inspect state, and why does that matter for confidence?
  • How do you return home in your shell, and when is that your reset move?
  • What's the difference between writing a file and reading one?
  • What key quits a pager, and what key cancels a running command?