Linux command-line course
Learn Linux in a real terminal
One hundred short lessons, from your first ls to your first shell script. Every lesson comes with a live Linux machine next to the text: read, try it, and let the machine check your work. 100 of 100 lessons published.
Module 1
First steps in the terminal
What a shell is, how to read the prompt, and how to move around the filesystem without fear.
- 01. What is a shell, and why the terminal 12 min
- 02. Reading the prompt and typing your first commands 15 min
- 03. Where am I? pwd and the filesystem tree 15 min
- 04. Listing files with ls 15 min
- 05. Moving around with cd 15 min
- 06. Absolute and relative paths, . and .. 18 min
- 07. Getting help: --help and reading usage lines 15 min
- 08. Tab completion, history and editing the command line 15 min
- 09. ls in depth: -l, -a, -h, sorting, hidden files 18 min
- 10. clear, exit, reboot and what a reload means in TempMV 12 min
Module 2
Files and directories
Creating, copying, moving, deleting and inspecting files: the everyday verbs of the command line.
- 11. Creating directories with mkdir 12 min
- 12. Creating empty files with touch 12 min
- 13. Copying with cp 15 min
- 14. Moving and renaming with mv 12 min
- 15. Deleting with rm and rmdir, safely 15 min
- 16. Reading files: cat, more and less 15 min
- 17. head, tail and following a log 12 min
- 18. Wildcards: *, ? and [abc] 15 min
- 19. File types, stat and what a file really is 18 min
- 20. Module 2 recap: a small filing project 25 min
Module 3
Text, redirection and pipes
Where command output goes, how to send it into files or other commands, and the small text tools that make Unix Unix.
- 21. echo and printf 15 min
- 22. Redirecting output: > and >> 15 min
- 23. Redirecting input and error: <, 2>, 2>&1 20 min
- 24. Pipes: connecting commands with | 20 min
- 25. Counting with wc 15 min
- 26. sort and uniq 20 min
- 27. cut, paste and tr 20 min
- 28. The vi editor, part 1: modes, moving, saving 25 min
- 29. The vi editor, part 2: editing, searching, replacing 25 min
- 30. tee, /dev/null and the standard streams recap 20 min
Module 4
Finding things
grep, find and friends: locating files by name, size or age, and lines by pattern, plus a first taste of sed and awk.
- 31. grep: finding lines 15 min
- 32. grep options: -i, -n, -v, -c, -r 20 min
- 33. Regular expressions, part 1: ., *, ^, $ 20 min
- 34. Regular expressions, part 2: classes and groups with egrep 25 min
- 35. find by name and type 18 min
- 36. find by size, time and permissions 20 min
- 37. find -exec and xargs 22 min
- 38. which and the PATH lookup 15 min
- 39. sed: stream editing basics 25 min
- 40. awk: columns and simple reports 25 min
Module 5
Users, groups and permissions
Who you are, who owns what, and the rwx model that decides who may read, write or run a file.
- 41. Users and groups: id, whoami, who 15 min
- 42. /etc/passwd, /etc/group and /etc/shadow 15 min
- 43. Creating users and groups: adduser, addgroup 20 min
- 44. Switching users with su and setting passwords 20 min
- 45. Reading permissions: the rwx triplets 15 min
- 46. chmod with symbolic modes 15 min
- 47. chmod with octal modes 15 min
- 48. chown and chgrp 15 min
- 49. umask and default permissions 15 min
- 50. Directory permissions and special bits 20 min
Module 6
Processes and jobs
Seeing what is running, putting work in the background, and stopping it politely, or not.
- 51. What a process is: PIDs, parents, ps 15 min
- 52. ps options and reading its output 15 min
- 53. top: watching the system live 15 min
- 54. Background jobs: &, jobs, fg, bg 16 min
- 55. Signals and kill 16 min
- 56. killall, pidof and finding a process by name 15 min
- 57. nice and renice: priorities 15 min
- 58. sleep, time and measuring a command 15 min
- 59. nohup and keeping work alive 16 min
- 60. /proc: the kernel as a filesystem 25 min
Module 7
The system, disks and the environment
Kernel, memory, disk usage, mounts, time, and the environment variables every program inherits.
- 61. uname, uptime and hostname 12 min
- 62. Memory: free and /proc/meminfo 14 min
- 63. Disk space: df 13 min
- 64. Disk usage: du 14 min
- 65. Mounting and unmounting filesystems 16 min
- 66. Block devices: blkid, fdisk -l, /dev 16 min
- 67. dmesg and kernel messages 13 min
- 68. date and the system clock 14 min
- 69. Environment variables: env, export, printenv 16 min
- 70. The shell startup files and PATH 25 min
Module 8
Archives, compression and the network
Bundling files with tar, squeezing them with gzip, and the basic tools for asking whether the network is there.
- 71. tar: creating archives 18 min
- 72. tar: listing and extracting 16 min
- 73. gzip, gunzip and zcat 18 min
- 74. Other compressors: bzip2, xz and unzip 18 min
- 75. Network interfaces: ifconfig and ip 20 min
- 76. ping and reachability 16 min
- 77. DNS: nslookup and /etc/hosts 18 min
- 78. Downloading with wget 20 min
- 79. netstat, routes and ports 20 min
- 80. traceroute and diagnosing a path 30 min
Module 9
Shell scripting basics
Turning a sequence of commands into a program: variables, conditions, loops, functions and exit codes.
- 81. Your first script: shebang, chmod +x, running it 20 min
- 82. Variables and quoting 25 min
- 83. Command substitution and arithmetic 20 min
- 84. Conditions: test, [ ] and if 25 min
- 85. Loops: for 25 min
- 86. Loops: while and until 25 min
- 87. Functions 25 min
- 88. Arguments: $1, $#, $@ and shift 25 min
- 89. Exit codes, && and || 25 min
- 90. Reading input and a menu script 30 min
Module 10
Putting it all together
Links, aliases, PATH, xargs, diff, chaining commands, and a final project that uses everything you learned.
- 91. Hard links and symbolic links with ln 25 min
- 92. Aliases and small shell shortcuts 20 min
- 93. PATH and installing your own commands 25 min
- 94. xargs in depth 25 min
- 95. diff and patch 25 min
- 96. Chaining: ;, &&, ||, subshells and grouping 20 min
- 97. Scheduling with crontab 25 min
- 98. Checksums: md5sum and sha256sum 20 min
- 99. A troubleshooting checklist 35 min
- 100. Final project and course review 60 min