The Linux Command Line
A complete course on the Linux shell, from the first command to real shell scripts. 36 chapters in 4 parts: learn the shell, set up your environment, use the essential tools (packages, disks, network, find, backups, regular expressions, text processing), and write scripts with functions, loops, options and arrays. Each chapter here has short lessons with examples and review questions, and each part ends with a hands-on lab.
- Book by
- William Shotts
- linuxcommand.org
- 2026
- Lessons
- 321
These summaries are written in my own words to help me learn. They are not a copy of the book. Buy the book for the full text.
Parts and chapters
Part 1
Learning the shell
Learning the Shell
- 1Meet the shell and the terminalWhat Is the Shell?8 lessons
- 2Move around the filesystemNavigation8 lessons
- 3Look around the systemExploring the System9 lessons
- 4Copy, move, delete and link filesManipulating Files and Directories8 lessons
- 5Know your commands and find helpWorking with Commands10 lessons
Lessons
- 5.1 Know the four kinds of commands
- 5.2 Find the kind with type
- 5.3 Find the program file with which
- 5.4 Get help for builtins with help
- 5.5 Use --help for programs
- 5.6 Read the manual with man
- 5.7 Search the manual with apropos and whatis
- 5.8 Read info pages and README files
- 5.9 Make your own commands with alias
- 5.10 Summary of the chapter
- 6Redirect input and output, build pipelinesRedirection10 lessons
Lessons
- 6.1 Know stdin, stdout and stderr
- 6.2 Send output to a file
- 6.3 Send errors to a file
- 6.4 Send output and errors to the same file
- 6.5 Throw away output with /dev/null
- 6.6 Read input from a file
- 6.7 Join commands with pipelines
- 6.8 Use filters in a pipeline
- 6.9 Save and see at the same time with tee
- 6.10 Summary of the chapter
- 7How the shell reads your line (expansion and quoting)Seeing the World as the Shell Sees It11 lessons
Lessons
- 7.1 See expansion with echo
- 7.2 Pathname expansion
- 7.3 Tilde expansion
- 7.4 Arithmetic expansion
- 7.5 Brace expansion
- 7.6 Parameter expansion
- 7.7 Command substitution
- 7.8 Control expansion with double quotes
- 7.9 Stop all expansion with single quotes and the backslash
- 7.10 Use backslash escape sequences
- 7.11 Summary of the chapter
- 8Work faster with the keyboardAdvanced Keyboard Tricks9 lessons
- 9Permissions and usersPermissions11 lessons
Lessons
- 9.1 Know owners, groups and the world
- 9.2 Read the rights: r, w, x
- 9.3 Change rights with chmod (octal)
- 9.4 Change rights with chmod (symbols)
- 9.5 Set default rights with umask
- 9.6 Use the special bits
- 9.7 Become another user with su
- 9.8 Run a command as root with sudo
- 9.9 Change owner and group with chown and chgrp
- 9.10 Share a folder and change passwords
- 9.11 Summary of the chapter
- 10See and control processesProcesses10 lessons
Lessons
- 10.1 Know how processes start
- 10.2 List processes with ps
- 10.3 Watch processes live with top
- 10.4 Stop, background and foreground
- 10.5 Change the priority with nice and renice
- 10.6 Send signals with kill
- 10.7 Signal many processes with killall
- 10.8 Shut down the system
- 10.9 Use more process tools
- 10.10 Summary of the chapter
Part 2
Configuration and the environment
Configuration and the Environment
- 11Set up the environmentThe Environment10 lessons
Lessons
- 11.1 Know what is in the environment
- 11.2 Know the important variables
- 11.3 Know how the environment is built
- 11.4 Read a startup file
- 11.5 Know how child processes inherit
- 11.6 Start a program with a temporary variable
- 11.7 Change the environment so it stays
- 11.8 Edit files with a text editor
- 11.9 Activate the changes with source
- 11.10 Summary of the chapter
- 12Edit text with vi and vimA Gentle Introduction to vi(m)10 lessons
- 13Customize the promptCustomizing the Prompt6 lessons
Part 3
Common tasks and essential tools
Common Tasks and Essential Tools
- 14Install and manage software packagesPackage Management10 lessons
Lessons
- 14.1 Know the two package families
- 14.2 Understand packages, repositories and dependencies
- 14.3 Find a package
- 14.4 Install a package
- 14.5 Remove a package
- 14.6 Update the system
- 14.7 Ask questions about packages
- 14.8 Know the universal package formats
- 14.9 Know the "hard to install" myth
- 14.10 Summary of the chapter
- 15Work with disks and storage mediaStorage Media10 lessons
Lessons
- 15.1 Mount and unmount filesystems
- 15.2 List mounted filesystems
- 15.3 Mount by hand
- 15.4 Know why unmounting is important
- 15.5 Find the device names
- 15.6 Make partitions and filesystems
- 15.7 Test and repair filesystems with fsck
- 15.8 Copy raw data with dd
- 15.9 Make, mount and check ISO images
- 15.10 Summary of the chapter
- 16Use the network from the command lineNetworking9 lessons
- 17Find files with locate and findSearching for Files9 lessons
- 18Archive, compress and back upArchiving and Backup9 lessons
- 19Regular expressionsRegular Expressions12 lessons
Lessons
- 19.1 Know what a regex is
- 19.2 Search with grep
- 19.3 Use literals and metacharacters
- 19.4 Match any character with the dot
- 19.5 Use anchors
- 19.6 Solve a crossword with a regex
- 19.7 Use bracket expressions
- 19.8 Use POSIX character classes
- 19.9 Use alternation and groups
- 19.10 Use quantifiers
- 19.11 Put regex to work
- 19.12 Summary of the chapter
- 20Process textText Processing13 lessons
Lessons
- 20.1 Know where text is used
- 20.2 Look closer with cat
- 20.3 Sort lines with sort
- 20.4 Report repeated lines with uniq
- 20.5 Cut columns with cut
- 20.6 Put lines together with paste and join
- 20.7 Reverse lines and characters with tac and rev
- 20.8 Compare files with comm and diff
- 20.9 Apply changes with patch
- 20.10 Change characters with tr
- 20.11 Edit text in a stream with sed
- 20.12 Check spelling with aspell
- 20.13 Summary of the chapter
- 21Format outputFormatting Output7 lessons
- 22Print from the command linePrinting6 lessons
- 23Compile programs from sourceCompiling Programs8 lessons
Part 4
Writing shell scripts
Writing Shell Scripts
- 24Write your first scriptWriting Your First Script7 lessons
- 25Start a project: an HTML report scriptStarting a Project6 lessons
- 26Top-down design with functionsTop-Down Design7 lessons
- 27Make decisions with ifFlow Control: Branching with if11 lessons
- 28Read keyboard inputReading Keyboard Input8 lessons
- 29Loop with while and untilFlow Control: Looping with while / until8 lessons
- 30Find and fix errors in scriptsTroubleshooting13 lessons
Lessons
- 30.1 Fix missing quotes
- 30.2 Fix missing or unexpected tokens
- 30.3 Watch for unexpected expansions
- 30.4 Know the logic errors
- 30.5 Program defensively
- 30.6 Know set -e, set -u and pipefail
- 30.7 Check scripts with ShellCheck
- 30.8 Watch out for file names
- 30.9 Check all input
- 30.10 Test with test cases
- 30.11 Debug: find the area and trace
- 30.12 Look at values while the script runs
- 30.13 Summary of the chapter
- 31Choose with caseFlow Control: Branching with case5 lessons
- 32Positional parameters and optionsPositional Parameters9 lessons
Lessons
- 33Loop with forFlow Control: Looping with for7 lessons
- 34Work with strings and numbersStrings and Numbers8 lessons
- 35Use arraysArrays11 lessons
Lessons
- 35.1 Know what arrays are
- 35.2 Make an array
- 35.3 Use an array: count files by hour
- 35.4 Print all elements
- 35.5 Count elements and find the indexes
- 35.6 Fill arrays with read -a and +=
- 35.7 Read a file into an array
- 35.8 Slice and sort arrays
- 35.9 Delete arrays and elements
- 35.10 Use associative arrays
- 35.11 Summary of the chapter
- 36Exotica: advanced tricksExotica8 lessons
Exam objectives
Every RHCSA exam objective and the lesson where you learn it.
Part 1 — Learning the shell
- Move around the filesystem tree with absolute and relative pathsChapter 2 Move around the filesystem
- Copy, move, delete and link many files at once with wildcardsChapter 4 · 4.1 Select many files with wildcards
- Find out what a command is and read its documentationChapter 5 Know your commands and find help
- Redirect output and errors, and join commands with pipelinesChapter 6 Redirect input and output, build pipelines
- Predict how the shell expands a line, and control it with quotesChapter 7 How the shell reads your line (expansion and quoting)
- Edit, complete and reuse commands fast with the keyboardChapter 8 Work faster with the keyboard
- Read and set permissions, owners and special bits; use sudoChapter 9 Permissions and users
- List processes, control jobs and send signalsChapter 10 See and control processes
Part 2 — Configuration and the environment
- Understand the startup files and change the environment so it staysChapter 11 Set up the environment
- Edit any file with vi: move, change, search and replaceChapter 12 Edit text with vi and vim
- Design a prompt with information and colourChapter 13 Customize the prompt
Part 3 — Common tasks and essential tools
- Install, update and query packages on Debian and Red Hat systemsChapter 14 Install and manage software packages
- Mount disks, make partitions and filesystems, check imagesChapter 15 Work with disks and storage media
- Test the network, download with curl and wget, work safely with sshChapter 16 Use the network from the command line
- Find files by name, size, time and rights, and act on themChapter 17 Find files with locate and find
- Compress, archive and back up with tar and rsyncChapter 18 Archive, compress and back up
- Write regular expressions for grep, sed, find and vimChapter 19 Regular expressions
- Sort, cut, compare and change text with the classic toolsChapter 20 Process text
- Format output and print itChapter 21 Format output
- Build a program from source codeChapter 23 Compile programs from source
Part 4 — Writing shell scripts
- Write, run and place a script so it works like a commandChapter 24 Write your first script
- Split a program into functions with local variablesChapter 26 Top-down design with functions
- Make decisions with if, test, [[ ]] and (( ))Chapter 27 Make decisions with if
- Read and check user input, build menusChapter 28 Read keyboard input
- Repeat work with while, until and for loopsChapter 29 Loop with while and until
- Find and fix errors with ShellCheck and tracingChapter 30 Find and fix errors in scripts
- Give scripts arguments and optionsChapter 32 Positional parameters and options
- Change strings and calculate inside bashChapter 34 Work with strings and numbers
- Store lists and key-value data in arraysChapter 35 Use arrays
- Use subshells, process substitution, traps and safe temporary filesChapter 36 Exotica: advanced tricks