Memra
academic · intermediate

COMP 325 — UNIX

Live in the shell — 85 lessons across the user's and the programmer's view

A full UNIX course built the way the Athabasca syllabus is split: the User's View first — how the system is put together, how the shell parses a command line, files and inodes and the two kinds of link, globbing and quoting, file security with permissions, `umask` and the special bits, the file-processing toolkit, regular expressions with grep, sed and awk, redirection, pipes and FIFOs, and processes, job control and signals — then the System Administrator's and Programmer's View: Bourne shell programming from variables to traps and descriptor rewiring, the C shell and where it differs, Python 3 as a scripting replacement, then system programming proper — the kernel boundary and the real POSIX signatures, the descriptor table, fork, exec, wait and zombies, reliable signal handling with sigaction, pipes and IPC, and sockets, concurrent servers and the socket arithmetic the assignments ask you to justify. Commands and C are typed for muscle memory; the fiddly deterministic semantics — umask arithmetic, glob expansion, the wait status word — you compute in runnable Python and watch come out right. Every one of the three assignments' questions is reachable from a lesson, and the questions the papers want in prose are rehearsed as written answers you commit, then grade against the marking scheme.

0 / 85 lessons
We'll stop scheduling reviews for after it.

The System, the Shell, and the Command Line

57 cards
  1. What an operating system does 8 min ◈ 5
  2. The UNIX software architecture: API and AUI 10 min ◈ 6
  3. Three branches, one root, and why POSIX exists 9 min ◈ 5
  4. Anatomy of a UNIX command 9 min ◈ 7
  5. Shells: which one you are in, and how to leave it 11 min ◈ 7
  6. Why you do not log in as root 9 min ◈ 7
  7. Reading the manual, and asking the machine what it is 10 min ◈ 10
  8. Two editors, one buffer 11 min ◈ 10

Files, Inodes, and Links

66 cards
  1. What UNIX means by "file" 8 min ◈ 8
  2. Four routes to one file 9 min ◈ 9
  3. The name is not in the file 11 min ◈ 8
  4. Where things live, and what a login line says 10 min ◈ 10
  5. Nine fields and a type character 10 min ◈ 10
  6. When does a file keep its identity? 10 min ◈ 8
  7. Two names for one file, and one name for a name 12 min ◈ 13

Globbing, Quoting, and the Shell Environment

48 cards
  1. Making the shell leave your text alone 10 min ◈ 9
  2. Asterisk, question mark, and who actually expands them 10 min ◈ 9
  3. One bracket, one position 11 min ◈ 10
  4. Building a pattern out of position constraints 11 min ◈ 9
  5. Where your shell looks, and where your settings live 10 min ◈ 11

File Security: Permissions, umask, and the Special Bits

75 cards
  1. Users, groups, and the three permission classes 9 min ◈ 8
  2. The nine permission bits 9 min ◈ 9
  3. chmod: octal and symbolic 11 min ◈ 13
  4. Permissions on directories 12 min ◈ 11
  5. umask and default permissions 12 min ◈ 13
  6. Symbolic umask, and why 000 is dangerous 9 min ◈ 8
  7. SUID, SGID, the sticky bit, and reading a mode cold 12 min ◈ 13

File Processing: Viewing, Copying, Comparing, Packaging

47 cards
  1. Four ways to look, and one that lies 9 min ◈ 9
  2. Copying, moving, removing — and the permissions each one needs 11 min ◈ 10
  3. A difference is a program, not a report 10 min ◈ 10
  4. Three transforms that are not each other 10 min ◈ 9
  5. A shared device needs a queue 10 min ◈ 9

Searching and Filtering: Regex, grep, sed, awk, sort, find

74 cards
  1. Regular expressions: literals plus operators 10 min ◈ 9
  2. A glob is not a regular expression 9 min ◈ 9
  3. Pinning a match to a position 10 min ◈ 9
  4. Three tools on one trade-off 10 min ◈ 10
  5. Editing a stream you never open 10 min ◈ 10
  6. Every line is a row of fields 11 min ◈ 11
  7. Keys, adjacency, and an expression language 12 min ◈ 16

Redirection, Pipes, FIFOs, and Remote Commands

67 cards
  1. Three files are already open 10 min ◈ 8
  2. The shell re-points a slot before the command runs 10 min ◈ 9
  3. Why `2>&1` has to come last 11 min ◈ 11
  4. stdout of one into stdin of the next 10 min ◈ 9
  5. A pipe with a name on disk 10 min ◈ 9
  6. What the other machine is, and how you name it 11 min ◈ 10
  7. Quoting decides which machine does the work 12 min ◈ 11

Processes, Job Control, and Signals

62 cards
  1. What a process is, and how the shell runs a command 11 min ◈ 9
  2. Running a script written for another shell 11 min ◈ 10
  3. Process states and CPU scheduling 10 min ◈ 10
  4. Inspecting processes with ps and top 10 min ◈ 10
  5. Job control, terminal signals, and surviving logout 12 min ◈ 13
  6. The process hierarchy, and hunting a runaway job 11 min ◈ 10

Bourne Shell Programming I: Variables, Arguments, Control Flow

60 cards
  1. Running a script, and what a variable really holds 10 min ◈ 9
  2. Unquoted variables, command substitution and the exit status 10 min ◈ 10
  3. export, read, and the child environment 10 min ◈ 9
  4. Positional parameters and shift 10 min ◈ 10
  5. test, brackets and conditional branching 12 min ◈ 11
  6. Loops, command grouping and a complete script 12 min ◈ 11

Bourne Shell Programming II: Arithmetic, Here Documents, trap, exec, Functions

47 cards
  1. Because every variable is a string 9 min ◈ 10
  2. Putting a command’s input inside the script 9 min ◈ 9
  3. Ignoring, catching, and cleaning up 11 min ◈ 8
  4. A descriptor is a slot you can rebind 11 min ◈ 10
  5. Subroutines that live in memory 11 min ◈ 10

The C Shell, and Scripting in Python 3

63 cards
  1. The C shell dialect: same ideas, different language 11 min ◈ 9
  2. foreach, switch, and one-based arrays 11 min ◈ 10
  3. Start-up files and the exported environment 11 min ◈ 10
  4. onintr, and why C shell scripting lost 10 min ◈ 10
  5. Python 3 when the script outgrows the shell 12 min ◈ 11
  6. Tkinter GUIs in Python 3 12 min ◈ 13

System Programming I: The Kernel Boundary, Files, and Processes

62 cards
  1. What happens when you call read() 10 min ◈ 9
  2. The five calls the whole file API is built from 12 min ◈ 10
  3. And that is the whole trick behind dup 10 min ◈ 10
  4. Asking a file about itself 10 min ◈ 10
  5. A call that returns twice, and a corpse that needs collecting 12 min ◈ 12
  6. Replacing the program, keeping the process 12 min ◈ 11

Signals, Pipes, and IPC

53 cards
  1. Software interrupts, and the three things you can do about one 11 min ◈ 10
  2. The interface the book never shows 12 min ◈ 10
  3. Two descriptors from one call 12 min ◈ 12
  4. A pipe with a name, and a umask interaction 10 min ◈ 9
  5. Two children, two pipes, syscalls only 12 min ◈ 12

Sockets, Servers, and Concurrency

57 cards
  1. Six fields, filled in by four calls 12 min ◈ 10
  2. Why a TCP read must loop and a UDP read must not 10 min ◈ 10
  3. Iterative or concurrent, connection-oriented or not 12 min ◈ 11
  4. Resource arithmetic, and the tool that shows it 12 min ◈ 14
  5. From a toy to something that stays up 12 min ◈ 12
NORMAL ~/memra/learn/comp-325 utf-8 LF