Foundations · Module 3

Your computer's command line

I know the command line can look intimidating.

35 min 4 outcomes Foundations

Previously

From LLMs to agents

A Large Language Model (LLM) is like an incredibly well-read assistant who has consumed most of human knowledge available on the internet.

This module

Your computer's command line

I know the command line can look intimidating.

Next

Setting up your environment

Python is the language of AI development.

Progress

Mark this module complete when you can explain it without rereading every paragraph.

Why this matters

Everyone who is good at the command line was once staring at a blank terminal wondering what to type.

What you will be able to do

  • 1 Open a terminal on macOS or Windows and recognise the prompt.
  • 2 Move around folders, list files, and create simple files safely.
  • 3 Run a Python script and understand what the terminal output means.
  • 4 Explain what an environment variable is and why it matters for tools.

Before you begin

  • No previous technical background required
  • Read the section explanation before using tools

Common ways people get this wrong

  • Destructive defaults. Some commands do not ask twice. Use dry runs and explicit flags when you can.
  • Hidden environment changes. A command can update your environment and later steps fail in surprising ways.

1.3.1 Why Learn the Command Line?

I know the command line can look intimidating. A black screen with blinking text feels like something from a 1980s film. But here is the truth: the command line is the most powerful way to interact with your computer, and almost all AI development happens here.

1.3.2 Opening Your Terminal

On macOS:

  1. Press Cmd + Space to open Spotlight

  2. Type "Terminal"

  3. Press Enter

You will see a window with text ending in a $ or % symbol. This is called the prompt. It is waiting for your command.

On Windows:

  1. Press Win + X

  2. Select "Windows Terminal" or "PowerShell"

You will see a window with text ending in >. This is your prompt.

If you cannot find it, open the Start menu and type "Terminal" or "PowerShell" in the search box. Click the first result that appears. If a window opens with a dark background and a blinking cursor, you are in the right place.

1.3.3 Essential Commands

Here are the commands you will use most often. I am giving you both macOS/Linux and Windows versions.

Type the command exactly as shown, then press Enter. If you see an error, it usually means a typo or that the file is not in the place you expected.

Seeing where you are:

# macOS/Linux
pwd

# Windows
cd

This shows your current directory (folder). When you first open the terminal, you are usually in your home directory.

Listing files:

# macOS/Linux
ls

# Windows
dir

This shows all files and folders in your current location.

Changing directories:

# Both platforms
cd Documents

# Go up one level
cd ..

# Go to home directory
cd ~

Creating a folder:

# macOS/Linux
mkdir my-ai-project

# Windows
mkdir my-ai-project

Creating a file:

# macOS/Linux
touch hello.py

# Windows
echo. > hello.py

Mental model

Talking to the computer directly

The command line is a precise way to tell your computer what to do, and to see what it actually did.

  1. 1

    You

  2. 2

    Shell

  3. 3

    Operating system

  4. 4

    Files and processes

  5. 5

    Output

Assumptions to keep in mind

  • Commands are intentional. Copy and paste without understanding is how you accidentally delete the wrong folder.
  • You know where you are. Most beginner mistakes are really about paths, working directories, and hidden files.

Failure modes to notice

  • Destructive defaults. Some commands do not ask twice. Use dry runs and explicit flags when you can.
  • Hidden environment changes. A command can update your environment and later steps fail in surprising ways.

Check yourself

Quick check. Command line basics

0 of 5 opened

What does the prompt symbol at the end of the line mean

It means the terminal is ready for your next command.

Which command tells you where you are on macOS or Linux

pwd.

Scenario. You ran a command and nothing happened. What is the first calm check

Check for a typo, then read the output. Many commands succeed quietly and return you to a new prompt.

What does cd .. do

It moves you up one folder.

Why do environment variables matter for tools

They let you configure secrets and settings without hard coding them into your code.

Artefact and reflection

Artefact

A one page cheat sheet of commands you actually used.

Reflection

Where in your work would open a terminal on macos or windows and recognise the prompt. change a decision, and what evidence would make you trust that change?

Optional practice

Use pwd or cd to confirm where you are before running anything.