HackPathHackPath
CoursesRoadmapPracticePricing
>_
HackPath

Terminal Mastery

0%
Lessons
Foundations
01What Is a Shell?
12 min
02CLI vs GUI — Two ways to interact with a computer
14 min
03What Is Bash?
15 min
04Popular Shells — Bash, Zsh, Fish, and sh
16 min
05What is scripting?
16 min
06Configure Bash — Your working environment
18 min
Linux Basics
07Linux Filesystem Tree — Everything Is a File
16 min
08Move around — cd, pwd, and ls
18 min
09Create, copy, move, delete
20 min
10Linux Permissions — Read, Modify, and Understand Access Rights
22 min
11Finding Files — find and locate
20 min
12Completion and Keyboard Shortcuts — Type Less, Do More
18 min
Streams and Text Processing
13stdin, stdout and stderr — The Three Data Streams
16 min
14Redirect output — > and >>
16 min
15Redirect input — <
14 min
16Pipes — Connecting Commands Together
20 min
17Redirect stderr — Handling errors in your pipelines
18 min
18Advanced pipelines and recap
20 min
19grep — Filter and Search in Text
20 min
20sed — Transform text on the fly
20 min
21awk — Processing Structured Data
22 min
22sort, uniq, and wc — Sort, deduplicate, and count
16 min
23cut, paste and join — Working with columns
16 min
24tr — Transforming Characters
14 min
Text Editors
25Choosing your editor — nano, vim, and the others
12 min
26nano — The Accessible Editor
14 min
27vim — Understanding Modes
18 min
28vim — Movements, Operators, and Search
20 min
29vim — Registers, Macros, and Windows
20 min
30Configure your editor — .vimrc and .nanorc
14 min
Scripting Bash
31Variables and Types in Bash
18 min
32Operators and Arithmetic in Bash
16 min
33Conditions — if, elif, else and case
18 min
34Loops — for, while, and until
20 min
35Functions — Organize and reuse code
18 min
36Debugging and script robustness
18 min
Processes and Scheduling
37Understanding Linux processes
16 min
38ps and top — Observing processes
18 min
39Job control — fg, bg, nohup, and screen
18 min
40cron and at — Scheduling tasks
18 min
41kill, nice and renice — Control Priorities
14 min
42lsof, fuser, and Summary — Inspect Resources
16 min
Networking
43Ping, traceroute and network diagnostics
16 min
44curl and wget — Interacting with the web
20 min
45SSH — Secure remote connections
22 min
46rsync — Smart file synchronization
18 min
47ss, netstat, and nmap — Inspect the network
18 min
48nc, tcpdump, and Network Summary
16 min
System Administration
49apt and yum — Package Management
18 min
50tar, gzip and zip — Managing Archives
16 min
51df, du, mount and lsblk — Disks and storage
16 min
52systemd and journalctl — Managing Services
18 min
53Advanced Users, Groups, and Permissions
18 min
54Final Synthesis — Your Reference Workflow
20 min

Lesson 01

What Is a Shell?

Understand what a shell is, why it exists, and how it fits with the operating system — before typing a single command.

Terminal Mastery/What Is a Shell?

Before the First Command

Most courses make you type commands from the very first minute.
This lesson takes the opposite path: understanding what happens even before
pressing Enter.

When you type a command in a terminal, you are not speaking directly
to the operating system. There is an intermediary between you and the Linux kernel
— a program whose role is to receive what you type, interpret it,
and send it to the right place. That program is the shell.

The Shell: An Interpreter Between You and the Kernel

A modern computer is organized in layers. At the center is the kernel
— the program that directly controls the hardware: the
processor, memory, disks, network. The kernel is powerful but does not
speak human language. You do not communicate with it directly.

Above the kernel, programs provide an interface. The shell is one of them.
It is a command interpreter: it reads what you write, understands it
as an instruction, and asks the kernel to execute it.

When you type ls to list the files in a directory, here is what actually
happens: your terminal displays the characters you type. When
you press Enter, the terminal sends the line to the shell. The shell
recognizes ls as the name of a program. It asks the kernel to launch that
program. The kernel executes it and returns the result. The shell displays that
result in the terminal.

The shell is the interpreter that translates your commands into instructions understandable by the operating system kernel.

Shell comes from the idea of a “shell” — it is the outer layer that surrounds the kernel and allows you to interact with it.

Terminal and Shell: Two Different Things

A very common confusion among beginners: mixing up the terminal and
the shell.

The terminal is the program that displays text and captures your keyboard
input. It is the window you open — iTerm2 on macOS, GNOME Terminal
on Linux, Windows Terminal on Windows. The terminal handles display,
colors, fonts, scrolling.

The shell is the program running inside the terminal that
interprets your commands. Bash, Zsh, Fish — these are shells.

The simplest analogy: the terminal is the window. The shell is what
runs behind the window. You can change the shell without changing the
terminal, and change the terminal without changing the shell.

bash
You type
$echo $SHELL
Terminal prints
/bin/bash

This command asks your shell to tell you which shell it is. The
$SHELL variable contains the path to the currently used shell program.
If you see /bin/bash, you are using Bash. If you see /bin/zsh,
you are using Zsh.

Terminal is the display program. Shell is the command interpreter running inside it.

Why the Shell Exists

One might wonder why this intermediate layer is necessary.
Why not speak directly to the kernel?

The answer is simple: the kernel does not understand human language. It understands
system calls — very precise binary instructions. Writing system
calls directly to list files or copy a directory would be
extremely tedious and reserved for system programmers.

The shell solves this problem by offering a command language: a syntax
readable by a human that automatically translates into system calls.
cp file.txt folder/ is infinitely more accessible than the equivalent in
C system calls.

The shell also does much more than execute simple commands. It manages
variables, loops, conditions, functions. It can read script files
and execute entire sequences of commands automatically. That is
why we speak of shell scripting: the shell is also a full programming language.

The shell provides a human-readable language that automatically translates into instructions the kernel understands.

The Different Types of Shells

There are several shells, each with its own characteristics. You will encounter
several throughout your career.

sh — the Bourne Shell — is the ancestor. Created in 1979, it defined the basic syntax
that all modern shells inherited. Minimalist, universal,
present on practically all Unix systems.

Bash — Bourne Again Shell — is the direct evolution of sh created in 1989.
It is the default shell on the vast majority of Linux distributions and
was the default shell on macOS until 2019. It is the shell you
will use in this course.

Zsh — Z Shell — has been the default shell on macOS since Catalina (2019).
Highly compatible with Bash but with additional features and an
improved interactive experience.

Fish — Friendly Interactive Shell — is a modern shell designed to be
particularly pleasant to use interactively, with advanced autocompletion
and a slightly different syntax.

We will explore these distinctions in more depth in a dedicated lesson. For now,
remember that Bash is the reference standard — it is the one you must
master first.

Bash — Bourne Again Shell — is the reference shell of this course and the most widespread on Linux systems.

What the Shell Is Not

The shell is not the operating system. Linux, macOS, Windows — these are
operating systems. Bash is a program that runs on these systems.
You can have Bash on Linux, on macOS, and even on Windows via WSL.

The shell is also not the only way to interact with a system.
Graphical interfaces — file explorers, applications — also
interface with the kernel through other mechanisms. The shell is simply
the text-based interface, and for many tasks, it is by far the most
efficient.

Flashcards
Flashcards
Flashcard

Flashcard

Flashcard

Flashcard

Flashcard

Exercises

Exercise 1

Open your terminal and type the following command. Which shell are you using?

Exercise 2

Type the following command. What does it return and what does each
piece of information mean?

bash
You type
$uname -a

Exercise 3

Without using a search engine, explain in your own words the
difference between terminal, shell, and operating system. Then compare
with what you just read.

Next Lesson

You now know what a shell is and why it exists. The next
lesson explores the natural follow-up question: why use a
command-line interface rather than a graphical interface
— and in
which cases each is the best option.

Hands-on challenge

Practice what you learned — run it on your machine.

Do the challenge →

You're on a free lesson

Ready to go further?

Unlock all courses, exercises, real-world scenarios and flashcards — everything to build real skills.

Unlock full access →

No commitment · Cancel anytime

Sign in to track your progress.

Sign in to validate →

53 lessons locked in this course · 800+ students enrolled

$99/year — save 31% vs monthly

Unlock full access →