What is the Terminal? Complete Beginner Guide for Mac and Windows (2026)
Learn what the terminal is, how to open it on Mac and Windows, and master the core commands every developer uses daily. Real examples, exercises, and no assumed knowledge.
Most beginner tutorials assume you already know what the terminal is. This one doesn't. By the end you'll be able to navigate your file system, create project folders, run programs, and read error messages — all without touching your mouse.
Watch along as we open the terminal and run every command in this guide.
What is the terminal, and why do developers use it?
The terminal is a text-based interface to your computer. Instead of clicking icons and menus you type instructions and press Enter. The computer executes them immediately.
That sounds slower than clicking, but it isn't once you know the commands. A developer can:
Create 10 nested folders in one command instead of clicking "New Folder" 10 times
Install a library in 3 seconds with npm install instead of hunting through a GUI installer
Run the same sequence of steps every time with no mouse errors
Connect to a remote server that has no screen at all
Everything in modern development — installing Node.js, running Git, starting a Next.js app — happens through the terminal. There is no way around it.
How to open the terminal
macOS
Option 1 — Spotlight (fastest):
Press Cmd + Space
Type Terminal
Press Enter
Option 2 — Finder:
Go to Applications → Utilities → Terminal
You'll see a window with a prompt that looks something like this:
snippet
yash@MacBook-Pro ~ %
That % (or $ on older Macs) means the terminal is ready for a command.
Windows
Windows has three options. Here's what each one is:
App from Microsoft Store that hosts PowerShell, cmd, and more in tabs
Recommended
Install Windows Terminal (free, takes 2 minutes):
Open the Microsoft Store
Search for "Windows Terminal"
Click Install
Once open, Windows Terminal starts PowerShell by default. All commands in this guide will work in PowerShell unless marked otherwise.
The mental model: your terminal always has a location
Before any command makes sense, understand this: the terminal is always "inside" a folder on your computer. That current location is called the working directory. Every command you run acts relative to where you currently are.
Core navigation commands
See where you are — pwd / cd with no arguments
Mac/Linux:
bash
pwd
Output:
snippet
/Users/yash/Documents
Windows PowerShell:
powershell
cd
Output:
snippet
C:\Users\yash\Documents
pwd stands for "print working directory." It answers the question: where am I right now?
List what's in a folder — ls / dir
Mac/Linux:
bash
ls
bash
ls -la # show hidden files and file sizes too
Windows:
powershell
dir
powershell
ls # PowerShell also accepts ls as an alias for dir
Output (Mac example):
snippet
Desktop Documents Downloads Projects
Move into a folder — cd
bash
cd Documents
bash
cd Documents/Projects/my-app # jump multiple levels at once
bash
cd .. # go up one level to the parent folder
bash
cd ../.. # go up two levels
bash
cd ~ # jump to your home folder (Mac/Linux)
bash
cd$HOME# same thing on Windows PowerShell
Create a folder — mkdir
bash
mkdir my-project
bash
mkdir -p my-project/src/components # create nested folders in one go (Mac/Linux)
Start typing a folder or file name and press Tab. The terminal auto-completes it.
bash
cd Doc[TAB] # completes to: cd Documents
If there are multiple matches, press Tab twice to see them all. Use tab completion constantly — it prevents typos in paths.
Command history
Press the Up arrow key to scroll through previous commands. Press it repeatedly to go further back. Press Down to come forward. When you find the command you want, press Enter.
Running a script or program
Once you've installed a programming language or tool, you run it from the terminal.
Run a Python script:
bash
python3 my_script.py
Run a Node.js file:
bash
node app.js
Run a shell script:
bash
bash setup.sh
The pattern is always: program filename. The terminal finds the program, hands it the file, and shows the output.
Reading error messages
Error messages look scary but they always tell you exactly what's wrong.
Error
What it means
Fix
command not found: node
The program isn't installed, or the terminal can't find it
Install the program; restart the terminal
No such file or directory
The path you typed doesn't exist
Check spelling; run ls to see what's actually there
Permission denied
You don't have rights to run or edit this file
On Mac/Linux, prefix with sudo (only if you know why)
Is a directory
You used a file command on a folder
Add the -r flag, or switch to the folder-appropriate command
ENOENT
Node.js version of "No such file or directory"
Same fix — check your path
When you see an error, read the last line first. It's usually the clearest statement of what went wrong.
Shell, terminal, bash, zsh, PowerShell — what's the difference?
These words get mixed up constantly. Here's the short version:
Term
What it is
Terminal
The app/window where you type (Terminal.app on Mac, Windows Terminal on Windows)
Shell
The program running inside the terminal that interprets your commands
bash
A shell. Was macOS default until 2019. Still default on most Linux servers
zsh
A shell. macOS default since Catalina (2019). Mostly the same as bash for everyday use
PowerShell
Microsoft's modern shell for Windows. Different syntax from bash/zsh
cmd.exe
Windows legacy shell. Avoid it for new work
The terminal is the window. The shell is the engine inside it.
Hands-on exercise: build a project folder structure
Do this now. Open your terminal and run these commands exactly. By the end you'll have a real folder structure and you'll have used every command in this guide.
bash
# 1. Go to your home foldercd ~
# 2. Create a projects folder if you don't have onemkdir projects
# 3. Enter itcd projects
# 4. Create a new project foldermkdir my-first-site
# 5. Enter the projectcd my-first-site
# 6. Create the folder structuremkdir src
mkdir src/css
mkdir src/js
mkdir public
# 7. Create the main filestouch index.html
touch src/css/style.css
touch src/js/app.js
# 8. Confirm it all existsls -R