Read

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.

  1. 01. What is a shell, and why the terminal 12 min
  2. 02. Reading the prompt and typing your first commands 15 min
  3. 03. Where am I? pwd and the filesystem tree 15 min
  4. 04. Listing files with ls 15 min
  5. 05. Moving around with cd 15 min
  6. 06. Absolute and relative paths, . and .. 18 min
  7. 07. Getting help: --help and reading usage lines 15 min
  8. 08. Tab completion, history and editing the command line 15 min
  9. 09. ls in depth: -l, -a, -h, sorting, hidden files 18 min
  10. 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.

  1. 11. Creating directories with mkdir 12 min
  2. 12. Creating empty files with touch 12 min
  3. 13. Copying with cp 15 min
  4. 14. Moving and renaming with mv 12 min
  5. 15. Deleting with rm and rmdir, safely 15 min
  6. 16. Reading files: cat, more and less 15 min
  7. 17. head, tail and following a log 12 min
  8. 18. Wildcards: *, ? and [abc] 15 min
  9. 19. File types, stat and what a file really is 18 min
  10. 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.

  1. 21. echo and printf 15 min
  2. 22. Redirecting output: > and >> 15 min
  3. 23. Redirecting input and error: <, 2>, 2>&1 20 min
  4. 24. Pipes: connecting commands with | 20 min
  5. 25. Counting with wc 15 min
  6. 26. sort and uniq 20 min
  7. 27. cut, paste and tr 20 min
  8. 28. The vi editor, part 1: modes, moving, saving 25 min
  9. 29. The vi editor, part 2: editing, searching, replacing 25 min
  10. 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.

  1. 31. grep: finding lines 15 min
  2. 32. grep options: -i, -n, -v, -c, -r 20 min
  3. 33. Regular expressions, part 1: ., *, ^, $ 20 min
  4. 34. Regular expressions, part 2: classes and groups with egrep 25 min
  5. 35. find by name and type 18 min
  6. 36. find by size, time and permissions 20 min
  7. 37. find -exec and xargs 22 min
  8. 38. which and the PATH lookup 15 min
  9. 39. sed: stream editing basics 25 min
  10. 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.

  1. 41. Users and groups: id, whoami, who 15 min
  2. 42. /etc/passwd, /etc/group and /etc/shadow 15 min
  3. 43. Creating users and groups: adduser, addgroup 20 min
  4. 44. Switching users with su and setting passwords 20 min
  5. 45. Reading permissions: the rwx triplets 15 min
  6. 46. chmod with symbolic modes 15 min
  7. 47. chmod with octal modes 15 min
  8. 48. chown and chgrp 15 min
  9. 49. umask and default permissions 15 min
  10. 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.

  1. 51. What a process is: PIDs, parents, ps 15 min
  2. 52. ps options and reading its output 15 min
  3. 53. top: watching the system live 15 min
  4. 54. Background jobs: &, jobs, fg, bg 16 min
  5. 55. Signals and kill 16 min
  6. 56. killall, pidof and finding a process by name 15 min
  7. 57. nice and renice: priorities 15 min
  8. 58. sleep, time and measuring a command 15 min
  9. 59. nohup and keeping work alive 16 min
  10. 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.

  1. 61. uname, uptime and hostname 12 min
  2. 62. Memory: free and /proc/meminfo 14 min
  3. 63. Disk space: df 13 min
  4. 64. Disk usage: du 14 min
  5. 65. Mounting and unmounting filesystems 16 min
  6. 66. Block devices: blkid, fdisk -l, /dev 16 min
  7. 67. dmesg and kernel messages 13 min
  8. 68. date and the system clock 14 min
  9. 69. Environment variables: env, export, printenv 16 min
  10. 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.

  1. 71. tar: creating archives 18 min
  2. 72. tar: listing and extracting 16 min
  3. 73. gzip, gunzip and zcat 18 min
  4. 74. Other compressors: bzip2, xz and unzip 18 min
  5. 75. Network interfaces: ifconfig and ip 20 min
  6. 76. ping and reachability 16 min
  7. 77. DNS: nslookup and /etc/hosts 18 min
  8. 78. Downloading with wget 20 min
  9. 79. netstat, routes and ports 20 min
  10. 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.

  1. 81. Your first script: shebang, chmod +x, running it 20 min
  2. 82. Variables and quoting 25 min
  3. 83. Command substitution and arithmetic 20 min
  4. 84. Conditions: test, [ ] and if 25 min
  5. 85. Loops: for 25 min
  6. 86. Loops: while and until 25 min
  7. 87. Functions 25 min
  8. 88. Arguments: $1, $#, $@ and shift 25 min
  9. 89. Exit codes, && and || 25 min
  10. 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.

  1. 91. Hard links and symbolic links with ln 25 min
  2. 92. Aliases and small shell shortcuts 20 min
  3. 93. PATH and installing your own commands 25 min
  4. 94. xargs in depth 25 min
  5. 95. diff and patch 25 min
  6. 96. Chaining: ;, &&, ||, subshells and grouping 20 min
  7. 97. Scheduling with crontab 25 min
  8. 98. Checksums: md5sum and sha256sum 20 min
  9. 99. A troubleshooting checklist 35 min
  10. 100. Final project and course review 60 min