Chapter 01/10 — Terminal Fundamentals: Your First Steps into the Command Line
Terminal Fundamentals: Your First Steps into the Command Line
A practical beginner's guide to Windows, macOS, and Linux
Have you ever watched a developer open a black window, type a few commands, and suddenly create an entire project, install dependencies, or manage their system?
That window is called a Terminal.
For many beginners, the command line looks intimidating. It seems like a place where you need to memorize hundreds of mysterious commands just to get something done.
But here's the truth:
The terminal is simply another way to communicate with your computer.
Instead of clicking buttons and navigating menus, you type instructions and let the operating system execute them.
Whether you're using Windows, macOS, or Linux, learning the command line is one of the most valuable skills you can develop as a programmer.
In this article, we'll start from absolute zero.
By the end, you'll understand what a terminal is, how it differs from a shell, how to execute your first commands, and how to navigate the command-line environments of all three major operating systems.
Let's get started.
1. What Is a Terminal?
A terminal is an application that provides a text-based interface for interacting with your computer.
Traditionally, computers relied heavily on text-based interfaces. Users typed commands to perform operations instead of clicking graphical elements.
Today, we have beautiful graphical interfaces, but the terminal is still an essential tool.
For example, imagine you want to create a new folder.
Using a graphical interface:
- Open File Explorer or Finder.
- Navigate to the desired location.
- Right-click.
- Select New Folder.
- Enter the folder name.
Using a terminal:
mkdir my-project That's it.
One command creates the folder.
The terminal becomes especially powerful when you need to:
- Manage files and directories.
- Install software and dependencies.
- Run development servers.
- Work with Git and GitHub.
- Manage processes.
- Connect to remote servers.
- Automate repetitive tasks.
- Diagnose system problems.
For developers, the terminal isn't just an alternative interface. It's an essential part of the development workflow.
2. Terminal vs. Shell vs. Command Line
Before running commands, let's understand three terms that developers often use interchangeably.
Although they're related, they aren't exactly the same.
Terminal
A terminal is the application or interface where you type commands and see their output.
Examples include:
- Windows Terminal
- macOS Terminal
- GNOME Terminal
- iTerm2
- Alacritty
Shell
A shell is the program that interprets your commands and communicates with the operating system.
When you type:
mkdir my-project The shell interprets the command and executes the requested operation.
Popular shells include:
| Shell | Common Environment |
|---|---|
| Bash | Linux |
| Zsh | macOS |
| PowerShell | Windows, macOS, Linux |
| Fish | Linux, macOS |
| CMD | Windows |
Command Line
The command line refers to the text-based interface through which you interact with the shell.
You'll often hear developers say:
- Open your terminal.
- Run this command in your shell.
- Execute this from the command line.
In everyday development conversations, these expressions are often used loosely.
How Do They Work Together?
Think of it this way:
- Terminal: Where you type.
- Shell: What understands your commands.
- Operating System: What performs the requested operations.
Understanding this distinction will make the rest of this series much easier.
3. Getting Started on Windows
Windows provides several command-line environments.
The two most common options for modern Windows users are:
- Windows PowerShell
- Command Prompt (CMD)
Windows Terminal is a modern application that can host these environments in separate tabs.
Option A: Open Windows Terminal
There are several ways to open it.
Method 1: Start Menu
- Press the Windows key.
- Search for Windows Terminal.
- Open the application.
Method 2: Run Dialog
Press:
Win + R Then enter:
wt Press Enter.
Windows Terminal should open.
Option B: Open PowerShell
You can also search for PowerShell directly in the Start Menu.
PowerShell is a powerful command-line shell with scripting capabilities and access to Windows system management features.
Let's run our first command.
Get-Location This displays your current working directory.
For example:
Path ---- C:\Users\Developer Now try:
Get-ChildItem This displays files and directories in your current location.
You can also use its shorter alias:
ls That's right. PowerShell supports aliases for many common commands.
Option C: Open Command Prompt
Search for cmd in the Start Menu.
Then run:
cd This displays your current directory.
To list files and folders:
dir Remember that CMD and PowerShell are different shells. They have different syntax and capabilities.
We'll explore their differences throughout this series.
4. Getting Started on macOS
macOS comes with a built-in terminal application.
The default shell on modern macOS installations is Zsh.
Open Terminal
There are two easy methods.
Method 1: Spotlight Search
- Press
Command + Space. - Type Terminal.
- Press Enter.
Method 2: Finder
Navigate to:
Applications → Utilities → Terminal Open Terminal.
You should see a command prompt waiting for input.
Let's execute our first command:
pwd pwd stands for Print Working Directory.
It displays your current location.
For example:
/Users/developer Now list the files and directories:
ls To display additional details, including hidden files:
ls -la We'll explore these options in detail in the next articles.
5. Getting Started on Linux
Linux distributions usually provide a terminal application, although the exact application depends on your desktop environment.
Some popular terminal applications include:
- GNOME Terminal
- Konsole
- Xfce Terminal
- Alacritty
- Kitty
Open Terminal
On many Linux distributions, you can use:
Ctrl + Alt + T This shortcut works on many popular desktop environments, although it may vary.
Alternatively, search for Terminal in your applications menu.
Once the terminal opens, let's run:
pwd Then:
ls And finally:
whoami The whoami command displays the username of the current user.
For example:
developer Congratulations! You've already executed your first Linux commands.
6. Understanding Command Structure
Now that you've opened a terminal on each operating system, let's understand how commands are structured.
A typical command can contain several parts:
command [options] [arguments] Let's break it down.
Command: The program or operation you want to execute.
Options: Additional settings that modify the command's behavior.
Arguments: The values or targets on which the command operates.
For example:
ls -la /home/developer Here:
-
lsis the command. -
-lacontains options. -
/home/developeris the argument.
Another example:
mkdir my-project Here:
-
mkdiris the command. -
my-projectis the argument.
Not every command requires options or arguments.
For example:
pwd This command works without either.
Short and Long Options
Many command-line tools support both short and long options.
For example:
ls -a And:
ls --all Both display hidden files on typical Unix-like systems.
However, option names and syntax depend on the specific command and shell.
Never assume every command supports the same options.
7. Your First Essential Commands
Let's learn a few commands that you'll use frequently.
1. Print Your Current Location
macOS / Linux:
pwd PowerShell:
Get-Location CMD:
cd 2. List Files and Directories
macOS / Linux:
ls PowerShell:
Get-ChildItem CMD:
dir 3. Clear the Terminal Screen
macOS / Linux:
clear PowerShell / CMD:
cls 4. Display Your Username
macOS / Linux:
whoami PowerShell / CMD:
whoami 5. Display Command Help
PowerShell:
Get-Help Get-ChildItem CMD:
help Bash / Zsh:
man ls You can also use:
ls --help Note that --help is not supported by every command.
The man command opens a manual page when documentation is available.
These help systems are incredibly useful. Experienced developers don't memorize everything. They know how to find the information they need.
8. Understanding Paths
A path describes the location of a file or directory.
There are two important types of paths.
Absolute Path
An absolute path specifies a complete location starting from the filesystem root or an equivalent system-specific root.
Examples:
Windows:
C:\Users\Developer\Documents macOS:
/Users/developer/Documents Linux:
/home/developer/Documents Relative Path
A relative path describes a location in relation to your current working directory.
For example:
projects/my-app If your current location is:
/home/developer Then the relative path points to:
/home/developer/projects/my-app You'll frequently use relative paths when working with development projects.
We'll explore navigation and filesystem operations in much greater detail in Article 02.
9. Important Terminal Concepts for Beginners
Before moving on, there are a few concepts worth understanding.
Case Sensitivity
Linux and macOS filesystems are commonly case-sensitive, although macOS can also use case-insensitive filesystem configurations.
Windows filesystems are generally case-insensitive by default.
For example, on a typical case-sensitive Linux filesystem:
Project.txt project.txt These can be two different files.
Don't assume that filenames behave identically across operating systems.
Spaces in File and Directory Names
Consider this directory:
My Projects If you try:
cd My Projects The shell may interpret this as multiple arguments.
Instead, wrap the path in quotation marks:
cd "My Projects" This works in PowerShell, CMD, Bash, and Zsh.
Command History
Most interactive shells allow you to access previously executed commands.
Press the Up Arrow key:
↑ This displays your previous command.
Press it again to navigate further back through your history.
The Down Arrow key moves forward.
This simple feature can save you a lot of time.
Tab Completion
You don't always need to type the entire command or path.
Start typing a filename or directory name and press:
Tab Your shell may automatically complete the name.
For example:
cd Doc Press Tab, and the shell may complete it to:
cd Documents The exact behavior depends on your shell configuration and available completions.
10. Practice: Your First Terminal Exercise
Theory is useful, but the best way to learn the terminal is to use it.
Open your terminal and complete these exercises.
Task 1: Display your current location.
Task 2: Display the files and directories in your current location.
Task 3: Display your current username.
Task 4: Clear your terminal screen.
Task 5: Display the available help information for a command.
Task 6: Use the Up Arrow key to execute a previously entered command.
Try completing all six tasks without copying the commands directly from the article.
The goal is to become comfortable with the environment.
What's Next?
You've now learned the fundamentals of the command line and explored the basic differences between Windows, macOS, and Linux terminal environments.
But knowing how to execute commands is only the beginning.
In the next article, we'll explore one of the most important terminal skills: navigating and managing the filesystem.
We'll learn how to move between directories, create files, rename folders, copy data, and delete files safely.
Next Article: Navigating the File System Like a Pro
Final Thoughts
The terminal might look complicated at first, but don't let that discourage you.
You don't need to memorize hundreds of commands.
Start with a few essential operations, understand what they do, and practice them regularly.
Over time, the command line will become a natural part of your development workflow.
Remember:
The goal isn't to memorize commands. It's to understand how to communicate with your computer.
Happy coding!



