Linux Introduction
Linux is a free, open-source operating system kernel that quietly runs most of the internet: the majority of public web servers, nearly all cloud infrastructure, most supercomputers, Android phones, and countless routers and embedded devices. When people casually say "Linux," they usually mean a complete operating system built around that kernel — called a distribution — which bundles the kernel with a shell, system utilities, and a package manager. This lesson explains what Linux actually is, how its core pieces fit together under the hood, and gets you typing your first real commands.
Overview / How Linux Works
Strictly speaking, Linux is a kernel: a program that starts when your computer boots and manages the hardware — the CPU, memory, disks, and network cards — on behalf of every other program. The kernel decides which process runs on the CPU next, hands out memory to programs, talks to disk controllers to read and write files, and enforces the security boundaries between different users and programs. It does this through a well-defined set of system calls: the small number of doors (open a file, read bytes, create a process, send a network packet) that every application, no matter what language it is written in, must knock on to get anything done. Everything you run — a text editor, a web browser, a Python script — is a normal, unprivileged program that goes through the kernel for anything that touches hardware.
Linux traces its lineage to Unix, an operating system built at Bell Labs starting in 1969. Unix introduced ideas that Linux still uses today: a hierarchical filesystem, a command-line shell as the primary interface, small tools that do one thing well and can be combined, and the philosophy that "everything is a file" — regular files, directories, devices like your keyboard, and even some kernel information are all accessed through the same file-like interface. In 1983 Richard Stallman started the GNU Project to build a completely free (as in freedom, and usually as in cost) Unix-like set of tools, but GNU lacked a kernel of its own. In 1991, a Finnish student named Linus Torvalds released the missing piece: the Linux kernel. Combine the GNU tools with the Linux kernel and you get what purists call "GNU/Linux" and everyone else just calls Linux. It is released under the GNU General Public License (GPL), meaning the source code is freely available and anyone can inspect, modify, and redistribute it.
Because the kernel alone is not a usable system, companies and communities package it together with a shell, coreutils, a package manager, and often a desktop environment to create a distribution (often shortened to "distro"). This course uses Ubuntu (Debian-based, using the apt package manager) as its primary example, since it is the most common distro for beginners and cloud servers alike. The other major family is RHEL/Fedora/CentOS, which use dnf (or the older yum) instead of apt — the underlying Linux concepts are identical, but the commands for installing software differ. Other well-known distros include Arch, openSUSE, and Alpine, each making different tradeoffs between simplicity, stability, and control.
Linux was designed from day one as a multiuser, multitasking system: many people (or processes) can be logged in and running programs at the same time, each isolated from the others by the permission system you will study in depth later in this course. A special account called root has unrestricted access to the whole system; modern distros discourage logging in as root directly and instead use sudo to grant temporary, logged, elevated privileges for a single command. You interact with all of this primarily through a shell — a program that reads the commands you type, interprets them, and asks the kernel to carry them out. This course focuses on Bash (the Bourne Again SHell), the default interactive and scripting shell on almost every Linux distribution.
Syntax
Nearly every Linux command line follows the same general shape:
command [options] [arguments]
- command — the name of the program to run, e.g.
ls,cat,uname. - options (also called flags or switches) — modify how the command behaves. Short options use a single dash and a letter (
-l), and can often be combined (-lameans-land-atogether). Long options use two dashes and a full word (--all). - arguments — the things the command acts on, such as a filename or directory path.
A few terms you will see constantly from here on:
| Term | Meaning |
|---|---|
| Kernel | The core program that manages hardware, processes, and memory. |
| Shell | The program (e.g. Bash) that reads and interprets the commands you type. |
| Terminal | The window or device that lets you type into a shell and see its output. |
| Distribution | A complete OS built from the Linux kernel plus tools and a package manager (e.g. Ubuntu, Fedora). |
| Package manager | The tool used to install, update, and remove software (apt on Debian/Ubuntu, dnf/yum on RHEL/Fedora). |
| root | The administrative account with unrestricted access to the system. |
Examples
Open a terminal on an Ubuntu machine (or WSL, or a cloud server) and try these.
Example 1: Check the kernel version
uname -a
Output:
Linux webserver01 6.8.0-45-generic #45-Ubuntu SMP PREEMPT_DYNAMIC x86_64 x86_64 x86_64 GNU/Linux
uname prints system information; -a ( "all") shows the kernel name, hostname, kernel release and version, and the CPU architecture, all in one line. This confirms you are on a genuine Linux kernel and tells you which version, which matters when a feature or bug is version-specific.
Example 2: Identify the distribution
cat /etc/os-release
Output:
NAME="Ubuntu"
VERSION="22.04.4 LTS (Jammy Jellyfish)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 22.04.4 LTS"
VERSION_ID="22.04"
The kernel doesn’t tell you which distribution you’re on; that information lives in the plain-text file /etc/os-release, which every modern distro maintains. Reading it with cat (which just prints a file’s contents) is the standard way to script "is this Debian-based or RHEL-based?" logic.
Example 3: Orient yourself in the filesystem
whoami
pwd
ls -l /home
Output:
alice
/home/alice
total 4
drwxr-xr-x 5 alice alice 4096 Aug 3 10:15 alice
whoami prints the currently logged-in user, pwd ("print working directory") shows where you currently are in the filesystem, and ls -l /home lists the contents of /home in long format, revealing permissions, owner, group, size, modification date, and name for each entry. Together these three commands answer the questions every session starts with: who am I, where am I, and what’s here.
How It Works Step by Step
It helps to know what actually happens between pressing Enter and seeing output, using ls -l as the example:
- Bash reads the line you typed and splits it into the command name (
ls) and its arguments (-l). - Bash checks whether
lsis a shell built-in, an alias, or an external program. Sincelsis an external program, Bash searches the directories listed in thePATHenvironment variable (in order) for an executable file namedls, typically finding it at/usr/bin/ls. - Bash asks the kernel to create a new process for that program. Internally this is done with the
forksystem call (which clones the running shell process) followed byexec(which replaces that clone’s program code withls). - The kernel schedules the new
lsprocess onto a CPU core.lsmakes its own system calls — opening the directory and reading its entries — to ask the kernel for the directory listing. lsformats that raw data into the human-readable columns you see, and writes the text to its standard output (file descriptor 1), which the terminal is connected to.- When
lsfinishes, it exits with a status code (0 for success, non-zero for failure), which Bash stores in the special variable$?. Bash then prints a fresh prompt and waits for your next command.
Every command you run, from a one-word tool like pwd to a hundred-line script, follows this same fork-exec-run-exit cycle.
Common Mistakes
Mistake 1: Assuming Linux is case-insensitive
Unlike Windows, Linux filesystems are case-sensitive, so Documents and documents are two different names. Beginners coming from Windows often type the wrong case and get confused by the error.
cd projects
bash: cd: projects: No such file or directory
The actual folder is named Projects with a capital P. Fix it by matching the exact case, or use tab-completion (type cd Pro and press Tab) so the shell fills in the correct spelling for you:
cd Projects
Mistake 2: Overusing sudo out of habit
New users, after hitting one "permission denied" error, sometimes start prefixing every command with sudo just in case. This is risky: creating or editing files as root when you didn’t need to changes their ownership to root, which can then lock your own regular user account out of them later.
sudo ls ~/Documents
Listing files you already own never requires elevated privileges. Only reach for sudo when a command specifically needs to modify system-wide files or install packages:
ls ~/Documents
Best Practices
- Keep your system’s package index and installed packages up to date regularly.
- Use
sudofor individual privileged commands rather than logging in as root or opening a permanent root shell. - Use Tab to autocomplete commands, flags, and file paths — it’s faster and prevents case and typo mistakes.
- When you’re unsure what a command or flag does, check its manual page before running it, especially for anything destructive.
- Remember paths and filenames are case-sensitive and use forward slashes (
/), not backslashes. - Prefer your distro’s official package manager and repositories over ad-hoc downloaded binaries when installing software.
sudo apt update && sudo apt upgrade -y
On Debian/Ubuntu, apt update refreshes the local list of available packages and versions, and apt upgrade -y then installs the newer versions of whatever is already installed, automatically confirming prompts. On RHEL/Fedora, the equivalent is sudo dnf upgrade -y.
Practice Exercises
- Open a terminal and run
uname -aandcat /etc/os-release. Write down your kernel version and distro name and version. - Run
whoami,pwd, andls -lin that order. Based on the output, describe in one sentence who you are, where you are, and what’s in that directory. - Look up the manual page for
ls(hint: one command shows manual pages) and find the flag that lists hidden files (files whose names start with a dot). Try it against your home directory.
Summary
- Linux is technically a kernel; a full installable operating system built around it is called a distribution.
- The kernel manages hardware, processes, and memory, and exposes itself to programs through system calls.
- Linux descends from Unix and, combined with the GNU tools, forms what many call GNU/Linux, released under the GPL.
- Debian/Ubuntu use the
aptpackage manager; RHEL/Fedora usednforyum— same underlying OS, different package tooling. - You interact with Linux mainly through a shell — this course uses Bash — typing commands in the form
command [options] [arguments]. - Every command you run goes through the same fork-exec-run-exit cycle handled by the kernel.
- Filesystem names are case-sensitive, and
sudoshould be used sparingly and deliberately, not by default.
