A 38-minute working session on the mental model that makes Unix click: everything is a file, every tool does one job, and a pipe glues them into anything. From navigation and permissions to processes, pipes, and the text toolkit that makes you fast.
A graphical app lets you do one task at a time by clicking. The shell gives you a language for tasks instead — so you can save them, re-run them, and chain them together. And it all rests on one simple idea: files, folders, devices, and even running programs are all handled the same tiny way.
bash or zsh) is the little interpreter running inside that window — it reads your text and launches the real program for you.$PATH — a plain list of directories to search. Type git and it finds /usr/bin/git for you.The terminal is the window; the shell inside it reads your line and launches the program.
open, read, write, close.cat file.txt and cat /dev/null work the same way — both are just bytes you read.One small API; every resource looks like a stream of bytes.
They all run the same commands you'll learn here. They mostly differ in how pleasant they are to type into day to day — how much they help you with completion, history, and suggestions.
The standard shell on almost every Linux server, and what nearly every tutorial and script assumes.
Pro — installed by default everywhere, so your scripts run anywhere without surprises.
Con — plain out of the box: no live suggestions, and its tab-completion feels dated next to the others.
Runs your bash commands almost unchanged, but adds smarter completion and themes (via add-ons like Oh My Zsh). The default on macOS.
Pro — a big comfort boost while staying bash-compatible, so little has to be relearned.
Con — the best parts need plugins and a config file before they shine.
Designed to be pleasant from the first run: it suggests commands as you type and colors your line to catch typos — no config needed.
Pro — the friendliest experience out of the box; great for newcomers.
Con— its syntax isn't bash-compatible, so bash scripts and copy-pasted snippets won't run as-is.
How to choose Write your scripts in bash so they run on any machine. For your own daily typing, pick zsh or fish for the nicer experience — the commands you learn carry over to all three.
"Linux" is really just the kernel. What you install is a distribution — that kernel wrapped with a package manager, default tools, and a release policy. Pick the wrapper that fits your team; the shell underneath is identical everywhere.
The friendly default. Huge community, vast package set, rock solid. Ubuntu adds commercial backing (Canonical) and predictable LTS releases — the safe pick for most servers and desktops.
The enterprise lineage. RHEL ships paid long-term support; Rocky & Alma are free, bug-for-bug rebuilds; Fedora is the fast-moving upstream. Choose it where support and certified stability matter.
Minimal and DIY — you assemble the system and it updates continuously (rolling release). Bleeding-edge and superbly documented (the Arch Wiki). Great for control and for learning how Linux fits together.
Tiny and security-focused (~5 MB). Built on musl libc and busybox — the de-facto base image for containers, where every megabyte and CVE counts.
Like different grocery chains: the food is the same, only the aisles and checkout differ.
There are no drive letters. Every disk, USB stick, and network mount hangs off a single tree that starts at /. Master a handful of moves and you stop thinking about where things are.
/ (/etc/hosts); relative paths start from where you stand — your working directory (pwd).Everything descends from /. ~ is a shortcut to your own /home/<you>.
. — here (the current directory)... — one level up.~ — your home directory.- — the directory you were just in.pwd says where you are, lsshows what's here, cd moves you.
Plain ls hides detail. The flags you'll live in: -l long form, -a include hidden (dot-files), -h human sizes, -t newest first.
The shell expands *, ?, and […] into matching filenames before the command runs — so any command gets pattern matching for free.
Every file carries an owner, a group, and three permission sets — for the owner, the group, and everyone else. Once you can read rwxr-xr-x at a glance, permissions stop being scary.
rwxr-xr-x.-rwxr-xr-x = 755. Octal is just r=4, w=2, x=1 added up per audience.
Set bits numerically (755) or adjust them by letter (+x, g-w). On directories, x means "may enter", not "may run".
chown user:group hands a file to a new owner and/or group. -R recurses a directory tree. Usually needs sudo.
root bypasses every permission check. sudo runs one command as root — borrow the power, give it back. Prefer it to logging in as root.
Like an office: the owner has a key (rwx), their team can enter the room (r-x), the public can only read the sign on the door (r--). 777 props every door open.
A running program is a process with a numeric PID. You steer processes by sending signals — small, named messages — and you juggle several at once with jobs.
SIGTERM (please stop), SIGKILL (stop now, no questions), SIGINT (Ctrl-C), SIGHUP (the terminal closed).SIGTERM asks nicely and lets the process clean up. SIGKILLcan't be caught — last resort only.
ps aux — a snapshot of every process (owner, PID, CPU, memory, command).top / htop — the live view; sort by CPU or memory.pgrep nginx — find PIDs by name; pkill nginx signals them.kill -l — list every signal and its number.& starts a command in the background. Ctrl-Z suspends the foreground one; bg/fg resume it behind or in front.
Closing the terminal sends SIGHUP to its children. nohup (or a terminal multiplexer like tmux) detaches a task so it keeps going.
Every program has three streams: stdin, stdout, and stderr. Redirection rewires where they go; a pipewires one program's output straight into the next's input. That's the whole Unix superpower.
A pipe joins stdout → stdin. Note that stderr is not piped by default — a common gotcha.
tee splits a stream to a file and onward. xargs turns stdin into command arguments — the bridge for tools that read args, not stdin.
grep finds lines, sed edits streams, awk works in columns, and findwalks the tree. Learn their core flags and you can answer almost any "where / what / how many" question without writing a script.
-r recurse, -i ignore case, -n line numbers, -v invert.-i rewrites files — test without it first, or keep a backup (-i.bak).$0 is the whole line; $1…$n are the fields; -F sets the separator.-exec … or | xargs to run a command per match.uniq only collapses adjacent duplicates, so sort always comes first.cat.-f follows the file; -F survives log rotation; pipe into grep to follow only what matters. Ctrl-C to stop.A few bad → good swaps that show up in everyone's history, then five rules to walk out with.
|. Text is the universal interface between them.644/755); never chmod 777.SIGTERM lets a process clean up; keep SIGKILL (-9) for genuine hangs.Start every script with set -euo pipefail: exit on errors (-e), treat unset variables as errors (-u), and fail a pipeline if any stage fails (-o pipefail). It turns silent corruption into a loud, early stop.
"Write programs that do one thing well. Write programs to work together. Make text the universal interface."
— Doug McIlroy, the Unix philosophy
Five quick questions on the shell, permissions, processes, pipes, and the text toolkit — instant feedback, no sign-in.
Navigate with ← → or scroll · back to library