Skip to content

🖥️ Terminal & CLI Basics

Who is this for?

Complete beginners — no coding experience needed. If you've never opened a terminal before, you're in the right place.


What is a Terminal?

A terminal is NOT just another window on your screen. Let's understand the difference.

Regular Window vs Terminal

When you open Notepad, you get a window that can do exactly one thing — edit text. When you open a web browser, it can do one thing — show websites. These are like appliances — a toaster toasts, a kettle boils water.

A terminal is completely different. It's a special window that gives you a direct line to the operating system. It can do ANYTHING — create files, install software, talk to the internet, control hardware, manage users, run programs, and much more.

Regular Window (Notepad, Browser) Terminal
What it does One specific thing (edit text, show websites) ANYTHING the computer can do
Creates files? Only its own type (.txt, .docx) Any file type, anywhere
Installs software? ❌ No ✅ Yes
Talks to internet? Only through its own interface ✅ Direct HTTP calls, APIs, downloads
Controls hardware? ❌ No ✅ Yes (disks, network, devices)
Manages users? ❌ No ✅ Create, delete, modify users
Runs programs? ❌ No ✅ Any program, any script
Automates tasks? ❌ No ✅ Schedule, repeat, chain commands

The Café Analogy ☕

Think of your computer as a café:

Regular Window = Customer at a Table

You sit down, look at the menu, and pick from what's available. You can't go into the kitchen. You can't change the recipe. You get what's on the menu.

Terminal = The Owner Walking into the Kitchen

You walk straight into the kitchen. You can cook anything, change any recipe, hire staff, remodel the café, order new ingredients — you have full access to everything.

Another Way to Think About It

Terminal Notepad
Communication 📻 Walkie-talkie — two-way communication with the OS 📋 Poster — just displays stuff
You can... Send commands AND receive responses Only look at what's shown
Direction ↔️ Both ways → One way (display only)

The terminal is a conversation with your computer. Notepad is just a billboard.


GUI vs CLI

There are two ways to talk to a computer:

GUI CLI
Stands for Graphical User Interface Command Line Interface
How you interact 🖱️ Buttons, icons, mouse clicks ⌨️ Type text commands
Examples Windows Explorer, Settings app PowerShell, Command Prompt
Speed Slower (click, wait, click, wait) Faster (one command = done)
Learning curve Easy to start Steeper at first, then powerful
Automation Hard to automate Easy to automate
Precision Limited to what buttons exist Unlimited — any command possible

Back to the Café ☕

GUI CLI
How you order 👉 Point at the menu and say "that one" 🗣️ Tell the chef directly: "Make me a flat white, extra hot, oat milk, double shot, in a ceramic cup"
Precision You get what's on the menu You get exactly what you asked for
Customisation Limited to menu options Unlimited — describe anything

Why learn CLI?

GUI is like training wheels — great for getting started. CLI is like riding without them — faster, more control, and you can go anywhere.


What Languages Does Windows Understand?

Just like people speak different languages, your computer's terminal can understand different command languages. Windows has gone through a journey to get where we are today.

The History Timeline

1981 ─── MS-DOS born 💾
         (Terminal ONLY — no mouse, no icons, no windows!)

1985 ─── Windows 1.0 🖼️
         (GUI arrives! But DOS still runs underneath)

1990s ── CMD (Command Prompt) appears ⬛
         (The old black window — still DOS at heart)

2006 ─── PowerShell born 🔵
         (Modern, powerful, built for professionals)

2016 ─── Bash comes to Windows via WSL 🐧
         (Linux commands on Windows — best of both worlds)

2019 ─── Windows Terminal app 🪟
         (One app to run CMD, PowerShell, and Bash together)

2025+ ── Copilot CLI era 🤖
         (AI + Terminal = talk to your computer in plain English)

The Three Languages

Your Windows terminal can speak three main languages:

CMD (Command Prompt) PowerShell Bash
Age ~45 years old ~20 years old From Linux, came to Windows in 2016
Power level 🚲 Bicycle 🏎️ Sports Car 🏎️ Sports Car (different brand)
Café analogy The original owner who only speaks 50 words — enough to get basic stuff done The fluent manager — can describe anything, handle complex orders, run reports A foreign chef who speaks a different language — equally capable, different words
Still used? Yes, but mostly legacy Default on Windows ✅ Popular with developers
Good for Simple file operations Everything on Windows Linux tools, scripting, DevOps

Same Command, Three Languages

Task: "Show me what's in this folder"

dir
Get-ChildItem
# or the shortcut:
ls
ls

Fun fact

PowerShell's ls is actually a shortcut (called an alias) for Get-ChildItem. PowerShell created shortcuts that match Bash commands so people switching from Linux feel at home.


Your computer's file system is like a building with rooms inside rooms. Let's visualise it:

C:\                              ← Ground floor (root of the building)
├── Users\
│   └── ssutheesh\               ← YOUR room (home directory)
│       ├── Desktop\             ← Your desk
│       ├── Documents\           ← Filing cabinet
│       ├── Downloads\           ← Mailroom (stuff arrives here)
│       └── .copilot\            ← Copilot's private corner
├── Program Files\               ← Storage room (installed apps live here)
├── Windows\                     ← Building management (DO NOT TOUCH 🚫)
└── ssClawy\                     ← Your workspace / project room
    └── learning-docs\           ← This documentation project!

The Windows\ folder

This is like the building's electrical room. You can look, but don't touch anything unless you know exactly what you're doing.

The 5 Navigation Commands

These are the only 5 commands you need to move around your computer:

# Command What it does Building Analogy Example
1 pwd "Where am I right now?" Checking the sign on the door of the room you're in pwdC:\ssClawy
2 ls "What's in this room?" Looking around the room you're standing in ls → shows files and folders
3 cd foldername "Walk into that room" Opening a door and stepping through cd Documents
4 cd .. "Go back one room" Walking back out the door you came in cd .. → goes up one level
5 cd ~ "Take me home!" 🏠 Teleporting straight to your home room cd ~C:\Users\ssutheesh

Memory tricks

  • pwd = Print Working Directory (fancy way of saying "where am I?")
  • ls = List (list what's here)
  • cd = Change Directory (move to a different folder)
  • .. = "the room above me" (parent folder)
  • ~ = "my home" (tilde = home sweet home)

Understanding Paths

A path is just the address of a file or folder — like a street address for your computer. Let's break one down:

C:\ssClawy\learning-docs\docs\copilot-cli\terminal-basics.md
│    │          │          │       │              │
│    │          │          │       │              └── 📄 File (the person you're visiting)
│    │          │          │       └── 📁 Subfolder (apartment number)
│    │          │          └── 📁 Folder (building)
│    │          └── 📁 Project (street name)
│    └── 📁 Workspace (suburb)
└── 💿 Drive (city)

Real-world analogy:

Path Part Computer Real Address
C:\ Drive letter City (London)
ssClawy\ Workspace folder Suburb (Camden)
learning-docs\ Project folder Street (High Street)
docs\ Subfolder Building (Number 42)
copilot-cli\ Sub-subfolder Apartment (Flat 3B)
terminal-basics.md The file itself Person (Sarah)

Absolute vs Relative paths

  • Absolute path = Full address from the drive letter: C:\ssClawy\learning-docs\docs
  • Relative path = Directions from where you ARE right now: docs\copilot-cli

It's like saying "42 High Street, Camden, London" (absolute) vs "two doors down on the left" (relative).

Try These — A Guided Walk 🚶

Open your terminal and follow along. Type each command and press ++enter++:

Step-by-step exercise

Step 1 — Check where you are:

pwd
You should see something like C:\Users\ssutheesh or wherever your terminal opened.

Step 2 — Look around:

ls
You'll see a list of files and folders in your current location.

Step 3 — Go to your workspace:

cd C:\ssClawy

Step 4 — Confirm you moved:

pwd
Should show C:\ssClawy.

Step 5 — Look around the workspace:

ls

Step 6 — Go deeper into the learning-docs project:

cd learning-docs

Step 7 — Look around:

ls

Step 8 — Go even deeper:

cd docs

Step 9 — Go back one level:

cd ..

Step 10 — Confirm you went back:

pwd
Should show C:\ssClawy\learning-docs.

Step 11 — Teleport home:

cd ~
Now you're back in your home folder, no matter how deep you were!


PowerShell vs Copilot CLI Commands

This is an important distinction that trips up beginners. When you're using Copilot CLI, there are two different things you can talk to:

PowerShell Commands Copilot CLI Commands
You're talking to... 🏢 The BUILDING (operating system) 🤖 The AI ASSISTANT (Copilot)
Examples pwd, ls, cd, mkdir, cat /help, /clear, /model, /compact
Starts with Normal text (no special prefix) / (slash) or plain English
Works without Copilot CLI? ✅ Yes — these work in any terminal ❌ No — these ONLY work inside Copilot CLI
What they do Move files, create folders, run programs Control the AI, change settings, get help
Café analogy Talking to the kitchen equipment Talking to the AI assistant helping you cook

Seeing the difference

pwd                  ← PowerShell command (asking the BUILDING: "where am I?")
ls                   ← PowerShell command (asking the BUILDING: "what's here?")
/help                ← Copilot command (asking the AI: "what can you do?")
/clear               ← Copilot command (asking the AI: "clear this chat")
"create a new file"  ← Copilot (plain English — the AI figures out the PowerShell command for you)

The ! Trick

When you're inside Copilot CLI, everything you type normally goes to Copilot first. Copilot reads it, thinks about it, and then decides what to do.

But sometimes you want to skip the AI and send a command straight to PowerShell — no AI involvement, no thinking, no delay.

That's what the ! prefix does:

!ls        ← Goes STRAIGHT to PowerShell (instant, no AI)
ls         ← Goes to Copilot first (AI might try to "help" or interpret it)
!pwd       ← Instant answer from the OS
pwd        ← Copilot receives this, thinks, then gives you the answer

When to use !

Situation Use !? Why
Quick pwd to check location !pwd Faster — no need for AI
Quick ls to see files !ls Instant results
Running a build command !npm run build You know the exact command
"How do I find large files?" ❌ No ! Let the AI help you figure out the command
"Fix the bug in my code" ❌ No ! That's what the AI is for!

Rule of thumb

  • You know the exact command → use ! (bypass the AI)
  • You need help figuring out what to do → don't use ! (let the AI help)

The Walkie-Talkie Analogy (Again) 📻

Think of it like a walkie-talkie system with a translator in the middle:

Without !:   You → 🤖 Copilot (translates/helps) → 💻 PowerShell
With !:      You → 💻 PowerShell (direct, no translator)

Sometimes you want the translator. Sometimes you want to speak directly. The ! lets you choose.


What you learned

  • ✅ A terminal is a direct line to your operating system
  • GUI uses buttons and mouse; CLI uses text commands
  • ✅ Windows understands CMD, PowerShell, and Bash
  • ✅ Navigate with just 5 commands: pwd, ls, cd, cd .., cd ~
  • ✅ A path is just an address for files and folders
  • PowerShell commands talk to the OS; Copilot commands (starting with /) talk to the AI
  • ✅ Use ! to bypass Copilot and go straight to PowerShell