Learn
Linux Foundations
Build unshakeable command-line instincts from first principles.
Master the core commands and concepts every Linux professional uses daily. One command at a time, with real VMs and real feedback.
144 hands-on labs across 16 modules, about 40 hours of work. Every lab runs on a real virtual machine in your browser, and checks your work on the machine itself.
Modules and labs
Learn to move through the Linux filesystem with precision and confidence.
System files and directories every Linux engineer encounters. Know where things live and what they contain.
- The Filesystem Hierarchy - The standard map of top-level directories on every Linux system. Read the root with ls /, learn what each floor is for (/etc for settings, /var/log for logs, /h
- /etc/group - Read the Linux group roster in /etc/group. The four colon-separated fields (name, password placeholder, GID, members), how the member list works, why a primary
- /etc/fstab - Read the filesystem table that mounts every disk at boot. The comment header, the six whitespace-separated fields on each entry (file system, mount point, type,
- /etc/os-release - Read a machine identity card with /etc/os-release. The KEY=VALUE format, the three load-bearing keys (PRETTY_NAME, ID, VERSION_ID), and how scripts branch on ID
- /etc/passwd - Read the account roster with cat /etc/passwd. The seven colon-separated fields (username, password placeholder x, UID, GID, comment, home, shell) and how to rea
- /etc/hostname - Read the machine's own name from /etc/hostname. One line, one name, read at boot. Learn the file (persistent name) versus the hostname command (live name), how
- /etc/hosts - Read the local name table with cat /etc/hosts. What the file is for, the address-whitespace-name line shape, the two loopback lines that both mean this machine,
- /sys - Explore /sys, the virtual filesystem the kernel builds live from your hardware. The ten top-level drawers, the class grouping by device role, the net and block
- /proc - Read the live state of a running Linux machine through /proc, a virtual filesystem the kernel generates on demand. The numbered PID directories, the zero-byte f
- Operation Know Your Machine - The Important Files module capstone mission. Survey an unfamiliar server by reading its own key files: the FHS root (ls /), the account list (cat /etc/passwd),
Look inside files without changing them. Print, page, search, count, and identify file contents and metadata.
- more - Page through a file too long to dump with more, the simple older pager: open it with more <file, move forward with Space, search forward with /word, and quit wi
- less - Page through a file too long to dump with less, the interactive pager. Open it with less, add -N for line numbers or +/pattern to land on a word, then drive it
- tail - Read the end of any file with tail. The default last 10, choose a count with -n, start from a line with -n +N, and grab bytes with -c, all in the practice termi
- head - Take a first look at any file with head: the first 10 lines by default, an exact line count with -n, or a byte count with -c. Practice on the intercept log and
- tac - Print any file bottom to top with tac, cat spelled backwards. Reverse a log so the newest line is first, see the one-line-file edge case, and flip the output of
- xxd - Crack open a binary file with xxd: a clean hex dump with an offset, byte pairs, and an ASCII gutter, then -l to read only the first bytes and -b to drop to indi
- cat - Read any short file with cat: dump it whole, number the lines with -n, expose the invisible newlines and tabs with -A (and spot a file with no final newline), a
- hexdump - Read any file one byte at a time with hexdump. Learn the canonical -C layout (offset, 16 hex bytes, and an ASCII gutter), then meet the byte-swapped default for
- df - Read a whole disk at a glance with df. The six columns, human units with -h, one filesystem by path, and the one df output that is identical on every machine. d
- du - Weigh files and folders on disk with du. See why on-disk blocks differ from exact bytes (du -b matches wc -c), read sizes with -h, weigh several files in one co
- stat - Pull a file's record card with stat: the exact Size in bytes, owner, permissions, inode, and the three timestamps, plus cards for binaries and folders. stat is
- file - Identify what a file truly is by its contents, not its name, with the file command. Tell ASCII text from raw data from a directory, check several files at once,
- wc - Measure any file with wc: lines, words, and bytes in one shot, or isolate one with -l, -w, -c, or -m. Meet the missing-newline trap where wc -l returns 0, all i
- Operation Signal Intercept - The Reading Files module capstone mission. Drill cat, tac, head, tail, less, more, wc, file, stat, du, df, hexdump, and xxd in one hands-on intercept on a real
Create, copy, move, rename, and remove files and directories. Build and reshape the filesystem.
- readlink - Read where a symbolic link points with readlink. Plain readlink prints the raw target stored in the link; readlink -f canonicalizes, following every link and re
- ln -s - Plant a signpost with ln -s: a symbolic link that stores a PATH to another file, unlike a hard link that shares the inode. The command is silent, so you prove i
- ln - Give one file a second name with ln, a hard link: same inode, same data, no copy. ln is silent on success, so you prove the link with ls -i (both names share on
- mv - Meet mv, the one command that both moves and renames, because to Linux they are the same act. A new name renames the file; a folder moves it. mv is silent on su
- cp - Copy files and folders with cp. It is silent on success, so every drill runs cp then proves the result with ls or cat. Learn the core cp source dest shape, -v t
- rm - Remove files and directories with rm, the delete key that has no undo and no Trash. rm is silent on success, so every drill proves the effect with ls. Announce
- rmdir - Meet rmdir, the safe, narrow delete that removes an empty directory only. It succeeds in silence, so you prove each removal with ls. Its defining behavior is re
- mkdir - Make folders on demand with mkdir. It is silent on success, so every drill proves the result with ls. Learn -p to build a whole nested chain (and forgive a fold
- touch - Make a file exist from nothing with touch. It creates empty files, builds several at once, and updates the timestamp on files that already exist. touch is silen
- realpath - Resolve any path to its one true absolute, canonical form with realpath. It makes paths absolute, collapses . and .., and follows symlinks to their real target.
- dirname - Meet dirname, the mirror of basename: it keeps the folder part of a path and drops the final name. dirname /home/student/report.txt prints /home/student. A trai
- basename - Strip a path down to its last name with basename. Keep just the file name, drop a suffix with a second argument or with -s, handle a trailing slash, and shorten
- The Vault: Operation Archivist - The Manipulation module capstone mission. Drill mkdir, touch, cp, mv, ln -s, rm, rmdir, and the path readers (readlink, realpath, basename, dirname) in one hand
Switch between user accounts and run commands with elevated privileges. Understand root, su, and sudo.
- sudo: Borrow Root for One Command - See who you are with whoami and id, then borrow the root account for exactly one command with sudo. Read a root-only file, open a root shell with sudo -i, and p
- su: Become Another User - su makes you a different account on the same machine. Switch into another user with su - <name, learn what the dash changes, run one command as them with -c, re
Variables, aliases, shell configuration, command lookups, expansions, and quoting. Master the shell itself.
- Expansion Ordering - The capstone that ties the Bash Environment module together: the fixed order the shell applies expansions to a command line. Brace expansion first (text-only),
- Word Splitting - After the shell expands an unquoted variable or command substitution, it splits the result into separate words on IFS (space, tab, newline by default). That is
- Escape Characters - The backslash is the finest-grained quoting tool: it tells the shell to take the NEXT single character literally, switching off whatever special meaning it woul
- Quoting - The rule that ties the Bash Environment module together: three quoting modes. Single quotes switch off all expansion (everything literal), double quotes expand
- Glob Patterns - Act on many files with one short pattern using shell globs. Match any run of characters with , exactly one with ?, and one from a chosen set with []. See why a
- Command Substitution - Let one command find a value and drop it straight into your command line with $(command). Inline a command output into a sentence, capture it into a variable an
- Tilde Expansion - The shell replaces a leading ~ with a home directory. Print your own home with ~, build a path with ~/Documents, reach another user home with ~root, and use ~+
- Brace Expansion - Turn one line into many with brace expansion. Build a comma list, glue fixed text around it, count a range with steps and zero padding, multiply two braces into
- Bash Keyboard Shortcuts - Edit the command line at speed with readline keyboard shortcuts (default emacs mode). Ctrl-A and Ctrl-E jump to the ends, Alt-B and Alt-F move by word, Ctrl-U,
- source - Run a script in the CURRENT shell with source, so its variables, aliases, functions, and directory changes stick in your session. The heart of the lesson is the
- Reverse Search (Ctrl-R) - Find any command you ran before with Ctrl-R, an incremental reverse search of your shell history. Learn the reverse-i-search frame, the four keys that finish th
- .profile - Read the POSIX, shell-agnostic login file .profile: the banner that marks it a login file, the block that sources .bashrc only under bash, and the precedence ru
- .bash_profile - The startup file bash runs once at login. Why your aliases vanish over SSH, the sourcing block that pulls in ~/.bashrc, login versus non-login shells, and the p
- .bashrc - The ~/.bashrc file is your personal startup script: bash runs it for every new interactive terminal, so whatever you put there (aliases, exports, PATH additions
- The $PATH Variable - PATH is the colon-separated list of directories the shell searches, left to right, to find the program for a bare command name. Read it with echo $PATH, underst
- builtin - Force the shell to run its genuine built-in version of a name with builtin, skipping any function that shadowed it. The one-word fix for a wrapper function that
- command - Reach past aliases and functions to the real tool with command. Run the genuine program with command CMD, ask how a name resolves with command -v (the portable,
- whereis - Find the full address of a command with whereis. Read the one-line answer (binary, manual page, and source or config), narrow it with -b, -m, and -s, and unders
- which - Turn a command name into the real file that runs it with which. Locate ls and interpreters for a script first line, use -a to see every copy on PATH and which o
- type - Ask the shell what actually runs with type. It classifies a name as an alias, keyword, function, builtin, or file, and reports the winner in the order the shell
- unalias - Take a shortcut back with unalias. Remove one alias by name, watch command not found prove it is gone, meet the not found message for a name that was never an a
- alias - Give a long command a short nickname with alias. Define a shortcut, list every alias in the current shell, look one up by name, and add a safe default to a real
- unset - Make a shell variable truly disappear with unset. The plain form, -v for variables and -f for functions, and the distinction that trips everyone: name= leaves t
- export - Promote a private shell variable into the environment so child programs inherit it. Prove a plain variable is invisible to a child, then make it visible with ex
- printenv - Read the environment with printenv. Print the whole NAME=value list, look up one variable to get its bare value, learn why you pass the plain name and never $NA
- env - Meet the invisible list every program inherits, and the one command that both shows it and edits it. Print the whole environment with bare env, run a command wi
- Shell Variables vs Environment Variables - Two kinds of variable, one lesson. A plain shell variable is private to the shell you are in; an environment variable is one you exported, so child programs inh
- Mission Control: Operation Home Turf - The Bash Environment module capstone mission. Drill export, env/printenv, alias, type/which, command substitution, and brace expansion in one hands-on operation
Background processes, foreground/background switching, job listing, and process signals. Control what runs and when.
- fg - Pull a background or stopped job back to the front with fg. Bare fg for the newest job, %1 to name a job by number, %+ and %- for the current and previous job,
- Ctrl-Z and SIGTSTP - Freeze a running foreground job with the Ctrl-Z keystroke, which sends SIGTSTP and leaves the job Stopped, not killed. Stopped means frozen and resumable with f
- & Background Operator - Stop letting long jobs freeze your terminal. Append & to run a command in the background: the shell prints its job number and PID and hands your prompt straight
- Job Control Overview - The mental model that opens the Job Control module. One terminal can run more than one job: the foreground job owns your keyboard right now, background jobs run
- Keyboard Signals - The four control-key combinations that talk to the foreground program: Ctrl-C sends SIGINT (interrupt), Ctrl-Z sends SIGTSTP (suspend), Ctrl-backslash sends SIG
- nohup - Keep a job running after you log out with nohup. The nohup cmd & launch-and-leave form, why it pairs with &, redirecting output to your own file instead of nohu
- jobs - Read the roster of every program you backgrounded or paused in this shell with jobs. The four-part line (number, + / - symbol, state, command), -l for real PIDs
- bg - Rescue a job you started without an & using bg. Ctrl+Z stops it, then bg resumes it in the background so your prompt stays free and no progress is lost. Bare bg
- Operation Night Shift - The Job Control module capstone mission. Drill the & background operator, jobs, Ctrl-Z, bg, fg, and nohup in one hands-on operation on a real Linux VM. Mission
Chain commands together with semicolons, AND/OR operators, subshells, brace groups, and exit codes. Master the special variables that track process results.
- The $! Background PID - Meet $!, the shell variable that remembers the PID of your most recent background job. Fall into the famous ask-too-early trap on purpose, hear the silence, the
- The $ Shell PID Variable - Meet $, the variable that holds your shell's own process ID. Learn what a PID is, prove $ is a live number that varies per session but never moves within one,
- The $? Exit Code - Read the invisible scoreboard every command leaves behind. Make commands succeed and fail on purpose, read the last exit code with echo $?, learn why it changes
- Exit Codes - Every command reports a hidden number when it finishes: 0 for success, non-zero for failure. Make it visible with true, false, and a real ls, prove it is overwr
- {} Brace Grouping - Bundle commands into one unit with a brace group { }. See why braces run in your current shell so a variable or a cd sticks, contrast it with the subshell ( ) t
- () Subshell Grouping - Group commands in a subshell with ( ): a temporary copy of your shell where a variable or a cd vanishes when the group ends. Prove the isolation with a before-a
- Chaining Commands with || - The or-operator runs its right side only when the left side fails. Fire fallbacks with false echo recovered, rescue a failing ls, prove success keeps the gate s
- Chaining Commands with && - Every command leaves an exit code, and && reads it. Learn the success gate by doing: read exit codes with $?, watch the blind semicolon run past a failure, open
- The semicolon: run commands in sequence - Put several commands on one line with the semicolon and the shell runs them left to right, no matter how each one turns out. You chain echoes, watch a chain sur
Control where input comes from and where output goes. Redirect stdout, stderr, and stdin to files. Connect commands with pipes. Combine redirects for precise control over data flow.
- Combining Redirects: Aim Every Stream - The module's final move: stack the operators you already own. Split a command's results and errors into two files with one line, merge both channels so a pipe c
- Split the Stream with tee - End the see-it-or-save-it trade. Watch a line land on screen and in a file at once with tee, snapshot a pipeline mid-flight without disturbing its result, and g
- Pipe Chains: Build a Pipeline - Chain two or more pipes into a pipeline: sort and dedupe a stream, pull the largest value with a numeric sort, tally repeats with uniq -c, and filter mid-stream
- The Pipe: Feed One Command into Another - Meet the pipe: the operator wires one command's stdout into the next command's stdin, no file in between. Count lines, trim a stream, and transform text mid-flo
- The Null Device: /dev/null - Meet /dev/null, the null device that destroys everything written to it. Shred a command's errors with 2/dev/null, keep only the errors with /dev/null, silence a
- Merge Streams with 2>&1 - Fold the error channel into stdout with 2&1. Merge both streams of a report into one file, learn why the order of redirections matters, then send errors through
- Redirect All: &> - One operator to capture everything a command says. Watch a plain let the stderr line escape to the screen, catch both channels in one file with &, verify the co
- Catch Errors with 2> - Steer the error channel. Prove errors ride channel 2 by watching one line refuse to leave the screen, then catch complaints in a file with 2, capture a real ls
- Input Redirection - Feed a file into a command's stdin with the < operator. The shell opens the file, the command reads a nameless stream, and the output proves it: wc -l < fruits.
- Append with >> - The single erases a file every time it writes. The double appends: it adds new lines to the end and never touches what is above. Build a three-line log in the p
- The > Operator: Redirect Output to a File - Meet the operator: point a command's stdout at a file instead of the screen. Write a file with one command, verify it with cat, discover that overwrites, then p
- File Descriptors: The Three Channels - Every command has three numbered channels: stdin (0), stdout (1), stderr (2). Watch the wiring in a live flow diagram, prove the two output channels are separat
- Operation Signal - The I/O Redirection module capstone mission. Drill , , <, 2, /dev/null, 2&1, &, pipes, pipe chains, tee, and combining redirects in one hands-on operation on a
Feed multi-line text directly into commands without creating files first. Use heredocs, tab-stripped heredocs, herestrings, and process substitution to build flexible data pipelines.
- Process Substitution - A command dressed as a file: process substitution <(...) lets diff compare two live commands with no temp files, a one-line ; echo $? reads the identical-or-not
- The <<< Herestring - Feed one string to any stdin-reading command with the herestring <<<: no temporary file, no heredoc delimiter. Drilled against cat, grep, wc -w, and tr, plus re
- The <<- Tab-Stripped Heredoc - One dash turns << into <<-, the heredoc that strips leading tabs from its body and closing delimiter so you can indent blocks inside scripts. Tabs only, never s
- The << Heredoc - Feed a multi-line block of text straight into any command with the << heredoc: pick a delimiter word, close the block exactly, quote the delimiter to stop expan
Transform, filter, sort, and reshape text from the command line. Master the core text-processing toolkit that makes Linux powerful for data manipulation, log analysis, and automation.
- tr - Translate, delete, and squeeze characters with tr: map a-z to A-Z, strip a set with -d, collapse repeats with -s, and keep only what you name with -c. Learn the
- printf - Print exactly the output you describe with printf: the %s, %d, and %f placeholders, the \n and \t escapes, field width and justify with %5s and %-10s, precision
- grep - Search text with grep: print the lines that match a word, then the flags an engineer reaches for. Count with -c, number with -n, ignore case with -i, invert wit
- cut - Slice a column out of every line with cut: fields by delimiter using -d and -f, characters by position with -c, the four list forms (N, N,M, N-M, N-), and --com
- sort - Put lines in order with sort: the lexical default, -r to reverse, -u for sorted-and-unique, and -n to fix the classic trap where 10 sorts before 2. Then sort on
- uniq - Collapse repeated lines with uniq. The one rule that trips everyone: uniq only compares adjacent lines, so you sort first. Count with -c, split repeats from lon
- paste - Merge files side by side with paste, the horizontal partner to cat. The default tab seam, a custom delimiter with -d, and folding one file onto a single line wi
- join - Stitch two files into one with join, matching lines on a shared key field. Learn the default field-1 match, the -1 and -2 key selectors, the -t delimiter, and t
- comm - Compare two sorted lists with comm: three columns for only-in-first, only-in-second, and in-both. Suppress columns by number with -1, -2, -3; use -12 for the ov
- diff - Compare two files line by line with diff. Read the normal report where < is the first file and is the second, learn the silence of identical files and the exit
- patch - Ship a change, not a whole file. patch applies the record diff wrote: patch old < change.patch edits the file, patch -R undoes it, --dry-run tests it safely, an
- column - Turn ragged, space-separated data into a clean aligned table with column. The -t table flag that does the aligning, -s to split on a colon, -o to draw a separat
- Regular Expressions - Describe SHAPES of text, not exact spellings, with regular expressions, practiced through grep -E. The dot, the ^ and $ anchors, the , +, and ? quantifiers, [..
- sed - Transform text line by line with sed, the stream editor. Substitute with s/OLD/NEW/, replace every match with the g flag, print one line with -n and p, delete w
- awk - Read text as fields with awk: address columns as $1, $2, $0, use the comma in print to space them, and set the divider with -F. Meet the NR and NF counters, fil
- Signal Station: Operation Signal Extraction - The Text Processing module capstone mission. Drill grep, cut, sort, uniq, tr, sed, and awk in one hands-on operation over a real signal log on a real Linux VM.
Build and manage argument lists for commands. Master xargs to turn input into arguments, handle special characters safely, and run commands in parallel.
- xargs - The first xargs lesson: the bridge from stdin to arguments. Feed xargs words from echo and cat, watch the default join everything into one run, hand items over
- Arguments Capstone: Signal in the Noise - The Arguments module mission on a real Debian machine. Ten objectives, no commands shown: turn lists into arguments with xargs, watch a space in a filename tear
- xargs quoting: the space-in-a-name trap - xargs splits its input on whitespace, so a filename with a space in it tears into two arguments. Watch five files become seven tokens, prove the damage with wc
- xargs Null-Delimited: the -0 fix - The whitespace trap left five files counting as seven tokens. Fix it for good with the NUL byte: find -print0 with xargs -0 (and its long spelling --null) keeps
- xargs -P: run jobs in parallel - Run xargs jobs in parallel with -P: up to N command runs at once. See why the on-screen order varies, prove a parallel run with sort and wc -l, shape run sizes
Find files and directories across the entire filesystem. Use find for real-time searches with powerful filters, and locate/mlocate for instant lookups from a pre-built database.
- find - Hunt through an archive with find filters: by name, case-blind name, type, size, age, and depth. Stack filters into precise one-line hunts, then prove it with t
- find -exec: Act on Every Match - Turn find from a search tool into an action tool with -exec. Run a command on every match with the {} placeholder and the ; terminator, see it fire once per fil
- locate - Read a prebuilt file list in an instant with locate: match a pattern with a wildcard, match a bare word as a substring anywhere in the path, count with -c, igno
- updatedb - Write the database that locate reads: build a private snapshot of the archive with updatedb (-U, -o, -l 0), prove it with a readback, then watch it go stale whe
- The locate Database: Snapshot vs Live - Why locate is fast and what it costs: locate reads a saved snapshot of paths built by updatedb, while find scans the live disk. Build the private snapshot, read
- Operation Deep Search - The Search module capstone mission. Drill find (bare sweep, name, type, size, age), find -exec, updatedb, and locate in one hands-on sweep on a real Linux VM. M
Measure, repeat, and generate. Use time to benchmark commands, watch to monitor changes, sleep to add delays, yes for auto-confirmation, and seq to generate number sequences.
- time - Put a stopwatch on any command with time. The three lines (real, user, sys) and what each means, timing a whole pipeline, and the external /usr/bin/time -v. tim
- watch - Turn any command into a live, full-screen dashboard with watch. The header-and-output frame, the -n heartbeat with fractions, -d to highlight changes, -t to dro
- sleep - Pause a shell for an exact duration with sleep. Seconds by default, the s/m/h/d suffixes for longer spans, decimals for fractions, and the && chain that proves
- yes - Control the one command built to never stop. yes repeats a line forever, so you learn to bound it with head, swap its default y for your own word, stop a runawa
- seq - Print a run of numbers with seq. Count to a number, choose both ends, step by any amount (the middle number is the step), zero-pad to equal width with -w, and j
- Mission Control: Operation Stopwatch - The Time module capstone mission. Drill time, watch, sleep, yes, and seq in one hands-on operation on a real Linux VM. Mission mode: no commands shown, recall r
Utility commands that serve specific purposes. Use true and false for exit codes in scripts, and script to record terminal sessions.
- true - Meet true, the command that does nothing and always succeeds. It prints nothing and exits 0, so you reveal that hidden result with echo $?. Its twin false alway
- false - Meet false, the mirror image of true: it prints nothing and always exits 1. See the failure with echo $?, trigger the fallback it guarantees, watch it ignore it
- script - Record a whole terminal session to a file with script. Name the file, exit to save, -a to append, -c to capture one command, and -q to record without banners. s
- Operation Black Box - The Special module capstone mission. Drill script, true, and false in one hands-on operation on a real Linux VM: record a session with script, then prove the ex
Run multiple terminal sessions inside a single connection. Use screen and tmux to keep processes alive after disconnecting, split windows, and manage long-running tasks.
- screen - Keep long jobs alive across a dropped SSH connection with screen. List sessions with -ls, start one bare or named with -S, detach with Ctrl-a d, and reattach wi
- tmux - Keep work alive across a disconnect with tmux, the modern terminal multiplexer. Detachable sessions, windows, and split panes in one terminal. The shell subcomm
- Operation Persistence - The Multiplexers module capstone mission. Drill screen and tmux in one hands-on operation on a real Linux VM: start a named session, detach to leave it running,
Frequently asked questions
How many labs are in Linux Foundations?
Linux Foundations has 144 hands-on labs, roughly 40 hours of guided work, spread across 16 modules.
Do I need my own server or hardware to do the Linux Foundations labs?
No. Every lab boots a real virtual machine in your browser, with a real Linux shell. There is nothing to install, and nothing on your own machine to break.
What level is Linux Foundations?
Labs in this track are rated beginner. The track starts from the beginning, so no prior experience is assumed.
Is Linux Foundations free?
Yes. Linux Foundations is free to work through, on real machines, with no card required to start.