Skip to the page
Introduction
I. How it works
1.
How the kernel works
1.1
What does the kernel do?
1.2
How the kernel shares the CPUs
1.3
How virtual memory works
1.4
Interrupts: how devices get attention
1.5
How a program starts: fork and exec
2.
How a CPU works
2.1
What a CPU does: instructions and architectures
2.2
Cores, threads and sockets
2.3
CPU caches: why memory layout matters
2.4
Clock speed, turbo and power saving
2.5
Speculative execution and CPU flaws
3.
How memory works
3.1
RAM and the memory hierarchy
3.2
NUMA: when some memory is closer
3.3
ECC and failing RAM
4.
How storage works
4.1
Hard drives, SSDs and NVMe
4.2
Inside an SSD: flash, TRIM and wear
4.3
From write() to the disk: the block layer
4.4
IOPS, throughput and latency: how fast is a disk?
4.5
fsync: when is data really on disk?
5.
How a GPU works
5.1
What a GPU does differently
5.2
GPU drivers: the kernel, Mesa and NVIDIA
5.3
How a picture reaches the screen: KMS, Wayland and X11
5.4
Computing on the GPU, and when your program can't see it
6.
How networks work
6.1
Network layers: OSI and TCP/IP
6.2
What happens when you open a website
6.3
IP addresses, subnets and NAT
6.4
TCP, UDP and connections
6.5
Ethernet, MAC addresses and ARP
7.
How containers and virtual machines work
7.1
What a container really is
7.2
Namespaces: a private view of the system
7.3
Images, layers and overlayfs
7.4
Virtual machines and hypervisors
7.5
Root in a container: users, capabilities and the docker group
8.
How programs do several things at once
8.1
Processes, threads and async: doing several things at once
8.2
Race conditions, locks and atomics
8.3
Event loops: one thread, thousands of connections
8.4
Too many open files: limits on processes
8.5
How processes talk: sockets, shared memory and D-Bus
9.
How filesystems work
9.1
How a filesystem stores a file
9.2
Journaling: how a filesystem survives a crash
9.3
Copy-on-write filesystems: snapshots and checksums
9.4
ext4, XFS, btrfs or ZFS?
9.5
The VFS: one interface for every filesystem
10.
How time works
10.1
Wall clock and monotonic clock: measuring time right
10.2
Keeping the clock right: NTP
10.3
Time zones, UTC and daylight saving
10.4
Timestamps: Unix time, 2038 and leap seconds
11.
How cryptography works
11.1
Hashes, encryption and signatures
11.2
Public-key cryptography
11.3
Certificates: how HTTPS proves who it is
11.4
Random numbers: /dev/urandom and entropy
11.5
Disk encryption: LUKS and the TPM
12.
How text is stored
12.1
Bytes and characters: ASCII, Unicode and UTF-8
12.2
Locales: why sorting, dates and numbers change
12.3
Line endings, BOMs and invisible characters
II. Your system
13.
Filesystem
13.1
The hierarchy in 2 minutes
13.2
/tmp vs /var/tmp
13.3
/proc and /sys
13.4
Links, inodes and "disk full"
13.5
fstab and mount options
13.6
/dev and udev
14.
Disk
15.
Permissions
15.1
rwx, octal and umask
15.2
setuid, setgid and sticky bit
15.3
sudo and groups
15.4
ACLs and capabilities
15.5
SELinux and AppArmor
16.
Processes & scheduling
16.1
Process states and zombies
16.2
Signals
16.3
nice and priorities
16.4
cgroups
17.
Memory
17.1
free vs available
17.2
The OOM killer
17.3
Swap and swappiness
17.4
The page cache
18.
CPU
18.1
Load average
19.
Network
19.1
Who listens on which port
19.2
DNS resolution
19.3
Interfaces and routes
19.4
nftables vs iptables vs ufw
20.
Boot
20.1
From firmware to init
20.2
The kernel command line
20.3
GRUB vs systemd-boot vs UKI
20.4
systemd targets
21.
Kernel
21.1
sysctl
21.2
Kernel modules
21.3
dmesg and the kernel log
21.4
syscalls and strace
21.5
Why a tool may not watch the kernel
22.
systemd
22.1
Units and timers
22.2
Why a service won't start
22.3
Unit files and overrides
23.
Libraries & binaries
23.1
Dynamic linking and ldd
23.2
ELF and "command not found"
23.3
PATH and command resolution
24.
Packages
24.1
Which package owns a file
24.2
Native packages vs Snap and Flatpak
25.
GPU
26.
Logs
26.1
Reading the journal with journalctl
26.2
Where logs go: journald, syslog and /var/log
26.3
Log rotation and logs that fill the disk
26.4
Logging from your own programs and services
III. Shell and commands
27.
Environment & shell
27.1
Where environment variables come from
27.2
Shell startup files
27.3
Redirections and file descriptors
27.4
Exit codes
28.
Finding and transforming
28.1
find
28.2
grep and regex
28.3
awk
28.4
sed
28.5
xargs
28.6
tar
28.7
rsync
28.8
jq
28.9
sort, uniq and cut
29.
Remote work: SSH and tmux
29.1
SSH keys and the agent
29.2
~/.ssh/config, jump hosts and host keys
29.3
SSH tunnels and port forwarding
29.4
tmux: sessions that survive a lost connection
29.5
Copying files over SSH: scp, sftp and rsync
30.
Git
30.1
How git stores your work
30.2
Undoing things in git
30.3
Merge or rebase?
30.4
Remotes: fetch, pull and push
30.5
Configuring git
☰
◐
⌕
devutils
/
ATFQ
/
book
ATFQ
git
Part II · Your system
24.
Packages
24.1
Which package owns a file
Every file a package installs is recorded in the package database: ask it who owns a file.
24.2
Native packages vs Snap and Flatpak
Native packages (deb, rpm, pacman) come from your distro, share its libraries, and are updated with the system.
Previous
23.3 PATH and command resolution
Next
24.1 Which package owns a file
‹
prev: PATH and command resolution
›
next: Which package owns a file