Most developers start their programming journey with a graphical interface: an IDE, buttons, menus, file explorers, and colorful dashboards.
Then, sooner or later, they encounter something that looks much more intimidating:
$
The Terminal.
For beginners, the terminal can feel old, difficult, and unnecessary. Why type commands when you can click buttons?
But as you become a developer, you begin to realize something important:
The terminal is not an outdated way of using a computer. It is one of the most direct ways to communicate with it.
In this article, we'll explore what the terminal is, why developers use it, how it works, and why learning it can fundamentally change the way you understand software.
What Is a Terminal?
A terminal is a text-based interface that allows you to interact with your operating system by typing commands.
Instead of this:
Open File Explorer
↓
Click a folder
↓
Find a file
↓
Right-click
↓
Choose an action
You can do this:
cd projects
or:
mkdir my_project
or:
rm old_file.txt
The terminal accepts your commands, sends them to the operating system, and displays the result.
A simplified model looks like this:
You
│
│ Type command
▼
┌─────────────┐
│ Terminal │
└──────┬──────┘
│
▼
┌─────────────┐
│ Shell │
└──────┬──────┘
│
▼
┌─────────────┐
│ Operating │
│ System │
└─────────────┘
There are actually several different components involved.
Terminal vs Shell vs Command Line
These terms are often used interchangeably, but they are not exactly the same.
Terminal
The terminal is the application or environment where you type commands.
Examples include:
- Windows Terminal
- GNOME Terminal
- iTerm
- Alacritty
The terminal provides the interface.
Shell
The shell is the program that reads and interprets your commands.
For example:
ls
The shell reads that command and decides what program or operation should be executed.
Popular shells include:
- Bash
- Zsh
- Fish
- PowerShell
The relationship looks like this:
┌──────────────────┐
│ Terminal │
│ │
│ You type here │
└────────┬─────────┘
│
▼
┌──────────────────┐
│ Shell │
│ │
│ Interprets input │
└────────┬─────────┘
│
▼
┌──────────────────┐
│ Operating System │
└──────────────────┘
So technically:
The terminal displays the interface. The shell interprets your commands.
Your First Terminal Commands
Let's imagine you are using Linux or macOS.
When you open a terminal, you might see something like:
farhad@computer:~$
This is called the prompt.
It means:
The shell is ready and waiting for your command.
Let's try a few commands.
Where Am I?
pwd
pwd means:
Print Working Directory
Example output:
/home/farhad
Your working directory is simply the folder you are currently inside.
List Files
ls
Example:
Documents
Downloads
Projects
Pictures
This command asks the operating system:
Show me the files and directories here.
You can also use:
ls -l
Which provides more information:
drwxr-xr-x Projects
-rw-r--r-- notes.txt
-rwxr-xr-x program
Now you are not just seeing file names. You are seeing information about files.
Moving Through the Filesystem
Suppose your computer contains:
home
└── farhad
├── Documents
├── Downloads
└── Projects
└── database
If you are currently here:
/home/farhad
You can enter the Projects directory:
cd Projects
Now:
pwd
might return:
/home/farhad/Projects
Then:
cd database
Now you are here:
/home
└── farhad
└── Projects
└── database ← You are here
To go back one directory:
cd ..
The .. means:
Parent directory.
To go directly to your home directory:
cd
These commands may seem simple, but they introduce one of the most important concepts in computing:
Everything has a location.
Creating Files and Directories
Create a directory:
mkdir my_project
Now:
current_directory
└── my_project
Move into it:
cd my_project
Create a file:
touch main.c
Now:
my_project
└── main.c
You just created a project structure without opening a graphical file manager.
For example:
mkdir database
cd database
mkdir src
mkdir include
mkdir tests
touch src/main.c
touch include/database.h
The result:
database
├── src
│ └── main.c
│
├── include
│ └── database.h
│
└── tests
This is one reason developers love the terminal.
You can describe a sequence of actions precisely.
The Terminal Is Built Around Programs
One important thing to understand is this:
ls
is not magic.
Usually, when you type a command, the shell searches for a program with that name and executes it.
For example:
gcc
starts the C compiler.
You might write:
gcc main.c -o app
Conceptually:
You
│
│ gcc main.c -o app
▼
Shell
│
│ Find gcc
▼
C Compiler
│
│ Compile main.c
▼
app
Then you can run your program:
./app
The terminal becomes the place where your entire development workflow happens.
Why Developers Prefer the Terminal
The biggest advantage is not that the terminal looks cool.
The real advantage is control.
With a GUI, you often perform actions manually.
For example:
Click
↓
Click
↓
Select
↓
Right-click
↓
Choose option
With the terminal:
command argument option
A command can be repeated exactly.
For example:
gcc main.c -o program
You can run the same command:
gcc main.c -o program
Again.
And again.
The instructions do not change.
This makes the terminal extremely useful for:
- Programming
- Building software
- Managing files
- Running servers
- Compiling code
- Debugging
- Automation
- Git
- Docker
- Databases
- System administration
Commands Can Be Combined
This is where the terminal becomes especially powerful.
Suppose you want to see all files ending in .c.
You can use:
ls
But you can also combine commands and filters.
For example:
ls | grep ".c"
The | symbol is called a pipe.
It connects programs together.
Conceptually:
┌──────┐
│ ls │
└───┬──┘
│
│ Output
▼
┌────────┐
│ grep │
└───┬────┘
│
▼
Result
This is one of the core ideas behind Unix-like systems:
Small programs can be combined to perform larger tasks.
Instead of building one giant program that does everything:
GIANT_PROGRAM
Unix philosophy encourages:
Small Tool
│
▼
Small Tool
│
▼
Small Tool
│
▼
Result
The terminal makes this composition natural.
Input, Output, and Redirection
Programs usually have three important streams:
Standard Input
Standard Output
Standard Error
You can think of them like this:
Keyboard
│
▼
stdin
│
┌──────────┐
│ Program │
└────┬─────┘
│
├──── stdout ────► Screen
│
└──── stderr ────► Error Message
The terminal allows you to redirect these streams.
For example:
echo "Hello" > output.txt
Normally:
echo "Hello"
prints:
Hello
But this:
echo "Hello" > output.txt
sends the output into a file.
The result:
output.txt
contains:
Hello
You can also append:
echo "Another line" >> output.txt
This simple concept is the foundation of many automation workflows.
The Terminal and Programming
If you are a C programmer, the terminal becomes especially important.
Imagine you have:
project
└── main.c
You compile it:
gcc main.c -o program
Now:
project
├── main.c
└── program
Run it:
./program
If you modify your source code:
main.c
You compile again:
gcc main.c -o program
Then run:
./program
This gives you a direct understanding of the software pipeline:
Source Code
│
▼
┌───────────┐
│ Compiler │
└─────┬─────┘
▼
Machine Code
│
▼
Executable
│
▼
Operating System
│
▼
Running Program
An IDE can hide this process behind a button called:
Run
But the terminal forces you to see what is actually happening.
That is valuable when you want to understand systems programming.
The Terminal Is Excellent for Automation
Imagine you have 1,000 files.
You want to perform the same operation on every file.
Doing this manually would be painful.
But with scripting:
for file in *.txt
do
echo "$file"
done
You can automate repetitive work.
A simple script might:
- Compile your program.
- Run tests.
- Create a backup.
- Generate logs.
- Deploy your application.
For example:
#!/bin/bash
gcc main.c -o app
./app
Instead of manually typing multiple commands, you can execute:
./build.sh
This is why terminals are closely connected to:
Automation
+
Programming
+
Reproducibility
The Terminal and Git
Modern software development would be difficult without version control.
A typical Git workflow looks like this:
git status
See what changed.
git add .
Stage changes.
git commit -m "Add database page implementation"
Create a commit.
git push
Send your changes to a remote repository.
Conceptually:
Your Files
│
▼
git add
│
▼
Staging Area
│
▼
git commit
│
▼
Local Repository
│
▼
git push
│
▼
Remote Repository
The terminal gives you direct access to these tools.
The Terminal Is Not Just for Linux
Many people associate terminals with Linux.
But command-line environments exist everywhere.
Linux
Common shell:
Bash
or:
Zsh
macOS
Common shells include:
Zsh
and Bash.
Windows
You can use:
Command Prompt
PowerShell
Windows Terminal
WSL
With WSL, Windows users can run a Linux environment directly alongside Windows.
The important thing is not the specific terminal application.
The important skill is learning how to think in commands.
The Terminal Changes How You Think
This is the part beginners often don't realize.
A graphical interface usually asks:
Where is the button?
The terminal asks:
What operation do I want to perform?
For example, instead of thinking:
Where is the button to create a directory?
You think:
I want to create a directory.
Then:
mkdir project
This is a more direct relationship between your intention and the operation.
The terminal encourages you to think in:
Input
↓
Process
↓
Output
That same model appears everywhere in programming.
A Practical Developer Workflow
Imagine starting a new C project.
You might do:
mkdir my_database
Then:
cd my_database
Create directories:
mkdir src
mkdir include
mkdir build
mkdir tests
Create files:
touch src/main.c
touch include/database.h
Compile:
gcc src/main.c -Iinclude -o build/database
Run:
./build/database
Check Git:
git status
Commit:
git add .
git commit -m "Create initial project structure"
In just a few commands, you have:
my_database
│
├── src
│ └── main.c
│
├── include
│ └── database.h
│
├── build
│ └── database
│
└── tests
The terminal becomes your development control center.
Is the Terminal Difficult?
At first, yes.
You need to remember commands.
You need to understand paths.
You need to understand files and permissions.
You will make mistakes.
But you do not need to memorize hundreds of commands.
Start with these:
pwd
ls
cd
mkdir
touch
cp
mv
rm
cat
clear
Then gradually learn:
grep
find
chmod
ps
kill
curl
ssh
Then developer tools:
git
gcc
make
cmake
python
docker
You learn the terminal the same way you learn programming:
One command at a time.
The Real Power of the Terminal
The terminal is powerful because it gives you a programmable interface to your computer.
A graphical interface is usually designed around predefined actions.
The terminal allows you to combine actions.
For example:
Program A
│
▼
Program B
│
▼
Program C
│
▼
File
You can create workflows that are:
- Repeatable
- Scriptable
- Automatable
- Precise
- Fast
That is why the terminal remains essential even in a world filled with advanced graphical tools.
Final Thoughts
The terminal might look simple:
$
But behind that small prompt is access to an enormous ecosystem of programs and system capabilities.
You can:
- Navigate your filesystem.
- Create and manage projects.
- Compile programs.
- Run applications.
- Debug software.
- Control Git repositories.
- Connect to remote servers.
- Automate repetitive tasks.
- Build complete development pipelines.
The terminal is not something you need to master in one week.
Start small.
Learn how to move:
cd
Learn how to inspect:
ls
Learn how to create:
mkdir
Then slowly connect those commands together.
Eventually, you may stop seeing the terminal as a black screen with confusing text.
You will see it for what it really is:
A direct interface between your ideas, your programs, and your computer.
And once you become comfortable with it, the terminal stops feeling like an obstacle.
It becomes one of the most powerful tools in your development workflow.
Top comments (0)