explainx.ainewsletter3.5k
TrendingNewsPathwaysSkills
Pricing
explainx.ai

Upskill in AI — 16 free pathways, live workshops & bootcamps, and 50+ courses from practitioners. Plus the skills, tools, and MCP servers to practice on.

follow us

custom AI agents

[email protected]

get started

Find your pathTake Free Evaluation

learn

pathways — start freeworkshopsbootcampscoursescertificationsmock testsexplainx universitycorporate traininglearn skills & mcp

discover

skillsmcp serversexplainx mcptoolsagentsllmsdesignsagi trackerranks

company

aboutvisionmissionteaminstructorscommunityhackathonscareers

content

daily AI newsstate of AI — live resultsblogreleasespromptsgeneratorsresource librarydemofor LLMs

solutions

all solutionsdeveloper upskillingmarketing upskillingproduct manager upskillingleadership upskilling

More from us

InfloqInfluencer marketingBgBlurPrivacy-first blurOlly SocialSocial AI copilotCeptoryVideo intelligenceBgRemoverBackground removal

newsletter · weekly

Get AI news, tools, and insights in your inbox.

supportprivacytermsdata rightssubmission guidelines

© 2026 AISOLO Technologies Pvt Ltd

On this page

  • What is the terminal, and why do developers use it?
  • How to open the terminal
  • The mental model: your terminal always has a location
  • Core navigation commands
  • Two time-saving shortcuts
  • Running a script or program
  • Reading error messages
  • Shell, terminal, bash, zsh, PowerShell — what's the difference?
  • Hands-on exercise: build a project folder structure
  • Mac vs Windows command reference
  • What to learn next
← Back to blog

explainx / blog

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.

Jun 27, 2026·6 min read·Yash Thakker
TerminalCommand LineBeginner GuideMacWindowsDeveloper Tools
go deep
What is the Terminal? Complete Beginner Guide for Mac and Windows (2026)

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):

  1. Press Cmd + Space
  2. Type Terminal
  3. 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:

ToolWhat it isRecommendation
Command Prompt (cmd.exe)Legacy shell, ships with WindowsOnly use if nothing else available
PowerShellModern shell, ships with WindowsGood, use if you don't want to install anything
Windows TerminalApp from Microsoft Store that hosts PowerShell, cmd, and more in tabsRecommended

Install Windows Terminal (free, takes 2 minutes):

  1. Open the Microsoft Store
  2. Search for "Windows Terminal"
  3. 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)

Windows PowerShell:

powershell
mkdir my-project
New-Item -ItemType Directory -Path "my-project\src\components" -Force

Create an empty file — touch / New-Item

Mac/Linux:

bash
touch index.html
touch style.css script.js    # create multiple files at once

Windows PowerShell:

powershell
New-Item index.html

Or the old cmd-style trick that still works in PowerShell:

powershell
type nul > index.html

Delete a file or folder — rm / del

Mac/Linux:

bash
rm old-file.txt
rm -r old-folder          # -r means recursive, needed to delete a folder

Windows PowerShell:

powershell
Remove-Item old-file.txt
Remove-Item old-folder -Recurse

Warning: rm on Mac/Linux does not move to Trash. The file is gone. Double-check before pressing Enter.


Copy a file — cp / Copy-Item

Mac/Linux:

bash
cp source.txt destination.txt
cp -r source-folder/ destination-folder/    # copy a whole folder

Windows:

powershell
Copy-Item source.txt destination.txt
Copy-Item source-folder -Destination destination-folder -Recurse

Move or rename a file — mv / Move-Item

Mac/Linux:

bash
mv old-name.txt new-name.txt     # rename
mv file.txt Documents/           # move to a different folder

Windows:

powershell
Move-Item old-name.txt new-name.txt
Move-Item file.txt Documents\

Clear the screen — clear / cls

Mac/Linux:

bash
clear

Windows:

powershell
cls

Or press Ctrl + L on both platforms.


Two time-saving shortcuts

Tab completion

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.

ErrorWhat it meansFix
command not found: nodeThe program isn't installed, or the terminal can't find itInstall the program; restart the terminal
No such file or directoryThe path you typed doesn't existCheck spelling; run ls to see what's actually there
Permission deniedYou don't have rights to run or edit this fileOn Mac/Linux, prefix with sudo (only if you know why)
Is a directoryYou used a file command on a folderAdd the -r flag, or switch to the folder-appropriate command
ENOENTNode.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:

TermWhat it is
TerminalThe app/window where you type (Terminal.app on Mac, Windows Terminal on Windows)
ShellThe program running inside the terminal that interprets your commands
bashA shell. Was macOS default until 2019. Still default on most Linux servers
zshA shell. macOS default since Catalina (2019). Mostly the same as bash for everyday use
PowerShellMicrosoft's modern shell for Windows. Different syntax from bash/zsh
cmd.exeWindows 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 folder
cd ~

# 2. Create a projects folder if you don't have one
mkdir projects

# 3. Enter it
cd projects

# 4. Create a new project folder
mkdir my-first-site

# 5. Enter the project
cd my-first-site

# 6. Create the folder structure
mkdir src
mkdir src/css
mkdir src/js
mkdir public

# 7. Create the main files
touch index.html
touch src/css/style.css
touch src/js/app.js

# 8. Confirm it all exists
ls -R

Expected output:

snippet
index.html  public  src

./public:

./src:
css  js

./src/css:
style.css

./src/js:
app.js

Now rename the project:

bash
cd ..                              # go up to projects/
mv my-first-site portfolio-site    # rename the folder
cd portfolio-site                  # go back in
ls                                 # confirm everything is still there

You just built and renamed a project using nothing but the terminal.

Weekly digest3.5k readers

Catch up on AI

Curated AI updates on agents, skills, and MCP — delivered to your inbox. Unsubscribe anytime.

Mac vs Windows command reference

TaskMac / LinuxWindows PowerShell
Where am I?pwdcd
List filesls or ls -ladir or ls
Change foldercd foldernamecd foldername
Go up one levelcd ..cd ..
Create foldermkdir namemkdir name
Create filetouch file.txtNew-Item file.txt
Delete filerm file.txtRemove-Item file.txt
Delete folderrm -r folderRemove-Item folder -Recurse
Copy filecp a.txt b.txtCopy-Item a.txt b.txt
Move/renamemv old newMove-Item old new
Clear screenclear or Ctrl+Lcls or Ctrl+L

What to learn next

The terminal is the foundation. Once you're comfortable here, everything else builds on top:

  • Git — version control you run entirely from the terminal. See the Git beginner guide.
  • Node.js — JavaScript on your computer, installed and run through the terminal. See the Node.js beginner guide.
  • Next.js — React framework you create and run with terminal commands. See the Next.js beginner guide.
  • Python — same pattern: install it, run scripts with python3 filename.py. See the Python beginner guide.

The terminal feels awkward for about a week. After that it feels faster than any GUI you've ever used.

Weekly digest3.5k readers

Catch up on AI

Curated AI updates on agents, skills, and MCP — delivered to your inbox. Unsubscribe anytime.

Yash Thakker

Written by

Yash Thakker

Yash is an AI expert with over 300K learners. Join his workshops →

Related posts

Jun 27, 2026

Python Basics: How to Install Python and Write Your First Script (2026 Guide)

Install Python, run your first script, understand variables and functions, and set up a virtual environment — the complete beginner Python setup guide for 2026 with real commands and exercises.

Jun 27, 2026

What is Cursor? How to Build Your First HTML Project with AI (2026 Guide)

Cursor explained from scratch: how to install it, how the AI works, and how to build a real HTML page from a plain-English description. Your first AI-assisted project in under 30 minutes.

Jun 27, 2026

What is Docker? How to Build Your First Docker Image (Beginner Guide 2026)

Docker demystified: what an image is, what a container is, how a Dockerfile works, and how to build and run your first container in under 20 minutes.