CSC 394 · Operating Systems
Our notes
2 min readHistory
UNIX was written at Bell Labs (1969) by Ken Thompson and Dennis Ritchie, rewritten in C (1973), which made it portable to other machines. Versions spread through universities (BSD from Berkeley) and companies (System V, Solaris, AIX). Linux was started by Linus Torvalds (1991) as a free UNIX-like kernel; with GNU tools it forms full systems (Ubuntu, Debian, Fedora). Android runs on the Linux kernel; macOS and iOS descend from BSD UNIX.
Design ideas ("the UNIX philosophy")
- Small programs that each do one thing well.
- Programs that work together through pipes.
- "Everything is a file" (devices appear as files in /dev).
- Plain-text configuration.
Structure
Hardware → kernel (process management, memory, file system, device drivers, system calls) → shell and utilities → user programs. The kernel is monolithic (Linux uses loadable modules).
Processes in UNIX
- Every process has a PID; the first is init (now systemd on most Linux), parent of all.
- fork() + exec() create new programs; wait() collects children; signals (kill -9 PID sends SIGKILL).
- Scheduling: Linux uses the Completely Fair Scheduler (CFS, until 2023) and then EEVDF, which share CPU time fairly by weighted priority; nice values from −20 (highest) to 19 (lowest).
File system
- One tree starting at / (root): /bin, /etc (configuration), /home (users' files), /dev (devices), /tmp, /var (logs), /usr.
- Each file has an inode holding its attributes and block pointers; the directory maps names to inode numbers. Hard links share an inode; symbolic links point to a path.
- File systems: ext4, XFS, Btrfs.
Permissions
Three classes (user, group, others) × three rights (read, write, execute). Shown by ls -l as -rwxr-xr--.
Octal: r = 4, w = 2, x = 1. rwx = 7, r-x = 5, r-- = 4.
Worked example. chmod 754 file → user rwx (7), group r-x (5), others r-- (4) → -rwxr-xr--. And -rw-r----- is 640.
The superuser (root) can do anything; sudo runs one command as root.
Common commands
| Command | Does |
|---|---|
| ls, cd, pwd | list, change, show directory |
| cp, mv, rm, mkdir | copy, move/rename, delete, make directory |
| cat, less, head, tail | show files |
| grep "word" file | search text |
| chmod, chown | change permissions, owner |
| ps, top, kill | list, watch, end processes |
| man command | the manual page |
Pipes and redirection: ls -l | grep ".txt" > list.txt sends matching lines into a file.
Why it matters today
Most web servers, cloud machines, supercomputers and phones (Android) run Linux; UniHive's own hosting runs on Linux. Learning the shell is a practical skill for any computing job.
Exams usually ask: brief history of UNIX and Linux; UNIX design philosophy; kernel vs shell; the UNIX file tree and inodes; permissions and chmod in octal; process commands; pipes.
Common mistake: reading chmod digits as user/others/group. The order is always user, group, others.
Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.
Read
-
Best pick Learning the shell - Lesson 1: What is the shell?
(opens linuxcommand.org in a new tab)
-
OSTEP: Interlude: Process API (fork, exec, wait)
Free chapter PDF from the authors' site (119 KB).
(opens pages.cs.wisc.edu in a new tab)
-
Learning the shell - Lesson 2: Navigation
(opens linuxcommand.org in a new tab)
-
Learning the shell - Lesson 4: A Guided Tour
(opens linuxcommand.org in a new tab)
-
Learning the shell - Lesson 9: Permissions
(opens linuxcommand.org in a new tab)
-
Unix
(opens en.wikipedia.org in a new tab)
Wikipedia, Unix, CC BY-SA 4.0 · licence
Watch
We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.