[{"data":1,"prerenderedAt":2078},["ShallowReactive",2],{"page-\u002Flinux\u002F01-introduction-and-architecture":3},{"id":4,"title":5,"body":6,"description":2071,"extension":2072,"meta":2073,"navigation":393,"path":2074,"seo":2075,"stem":2076,"__hash__":2077},"content\u002Flinux\u002F01-introduction-and-architecture.md","01 — Introduction & Architecture",{"type":7,"value":8,"toc":2049},"minimark",[9,13,22,27,179,199,203,217,266,269,279,313,318,426,447,451,454,563,567,587,591,708,716,742,803,807,847,1015,1019,1190,1194,1214,1346,1353,1441,1514,1518,1610,1614,1625,1703,1750,1754,1831,1835,1952,1956,1967,2045],[10,11,5],"h1",{"id":12},"_01-introduction-architecture",[14,15,16,17,21],"p",{},"Linux is a monolithic kernel managing CPU, memory, devices, and process scheduling. Combined with GNU userspace tools, a display server, and applications, it forms a ",[18,19,20],"strong",{},"Linux distribution",". This chapter covers the kernel–userspace boundary, syscall mechanics, the FHS, and the virtual filesystems that make Linux a unified system — through the lens of production code and edge-case behavior.",[23,24,26],"h2",{"id":25},"the-layers","The Layers",[28,29,31],"code-wrapper",{"language":30},"bash",[32,33,37],"pre",{"className":34,"code":35,"language":30,"meta":36,"style":36},"language-bash shiki shiki-themes github-light github-dark","┌─────────────────────────────────────┐\n│          Applications               │  Firefox, nginx, your scripts\n├─────────────────────────────────────┤\n│     GNU Userspace (coreutils)       │  bash, ls, grep, awk, sed, gcc\n├─────────────────────────────────────┤\n│          System Libraries           │  glibc, systemd, PAM, NSS\n├─────────────────────────────────────┤\n│            Linux Kernel             │  scheduler, memory, drivers, VFS\n├─────────────────────────────────────┤\n│          Hardware (CPU\u002FRAM\u002Fdisk)    │\n└─────────────────────────────────────┘\n","",[38,39,40,49,74,80,95,100,126,131,157,162,173],"code",{"__ignoreMap":36},[41,42,45],"span",{"class":43,"line":44},"line",1,[41,46,48],{"class":47},"sIsaT","┌─────────────────────────────────────┐\n",[41,50,52,55,59,62,65,68,71],{"class":43,"line":51},2,[41,53,54],{"class":47},"│",[41,56,58],{"class":57},"sJ6F3","          Applications",[41,60,61],{"class":57},"               │",[41,63,64],{"class":57},"  Firefox,",[41,66,67],{"class":57}," nginx,",[41,69,70],{"class":57}," your",[41,72,73],{"class":57}," scripts\n",[41,75,77],{"class":43,"line":76},3,[41,78,79],{"class":47},"├─────────────────────────────────────┤\n",[41,81,83,85,88,91],{"class":43,"line":82},4,[41,84,54],{"class":47},[41,86,87],{"class":57},"     GNU",[41,89,90],{"class":57}," Userspace",[41,92,94],{"class":93},"ssxIu"," (coreutils)       │  bash, ls, grep, awk, sed, gcc\n",[41,96,98],{"class":43,"line":97},5,[41,99,79],{"class":47},[41,101,103,105,108,111,114,117,120,123],{"class":43,"line":102},6,[41,104,54],{"class":47},[41,106,107],{"class":57},"          System",[41,109,110],{"class":57}," Libraries",[41,112,113],{"class":57},"           │",[41,115,116],{"class":57},"  glibc,",[41,118,119],{"class":57}," systemd,",[41,121,122],{"class":57}," PAM,",[41,124,125],{"class":57}," NSS\n",[41,127,129],{"class":43,"line":128},7,[41,130,79],{"class":47},[41,132,134,136,139,142,145,148,151,154],{"class":43,"line":133},8,[41,135,54],{"class":47},[41,137,138],{"class":57},"            Linux",[41,140,141],{"class":57}," Kernel",[41,143,144],{"class":57},"             │",[41,146,147],{"class":57},"  scheduler,",[41,149,150],{"class":57}," memory,",[41,152,153],{"class":57}," drivers,",[41,155,156],{"class":57}," VFS\n",[41,158,160],{"class":43,"line":159},9,[41,161,79],{"class":47},[41,163,165,167,170],{"class":43,"line":164},10,[41,166,54],{"class":47},[41,168,169],{"class":57},"          Hardware",[41,171,172],{"class":93}," (CPU\u002FRAM\u002Fdisk)    │\n",[41,174,176],{"class":43,"line":175},11,[41,177,178],{"class":47},"└─────────────────────────────────────┘\n",[180,181,182,189],"ul",{},[183,184,185,188],"li",{},[18,186,187],{},"Kernel space"," — privileged, full hardware access (ring 0 on x86).",[183,190,191,194,195,198],{},[18,192,193],{},"User space"," — unprivileged, goes through the kernel via ",[18,196,197],{},"syscalls",".",[23,200,202],{"id":201},"kernel-vs-userspace-the-syscall-boundary","Kernel vs Userspace — The Syscall Boundary",[14,204,205,206,209,210,213,214,216],{},"Every process runs in ",[18,207,208],{},"user space"," until it needs a kernel service (read a file, allocate memory, send a packet). It then issues a ",[18,211,212],{},"syscall"," — a controlled transition into kernel mode via a software interrupt or ",[38,215,212],{}," instruction.",[28,218,219],{"language":30},[32,220,222],{"className":34,"code":221,"language":30,"meta":36,"style":36},"# Complex Implementation: count every syscall `ls` makes against \u002Fetc\n# — reveals the true cost of \"just listing a directory\"\nstrace -c -e trace=openat,read,close,getdents64,statx ls \u002Fetc >\u002Fdev\u002Fnull 2>&1\n",[38,223,224,230,235],{"__ignoreMap":36},[41,225,226],{"class":43,"line":44},[41,227,229],{"class":228},"sdCPZ","# Complex Implementation: count every syscall `ls` makes against \u002Fetc\n",[41,231,232],{"class":43,"line":51},[41,233,234],{"class":228},"# — reveals the true cost of \"just listing a directory\"\n",[41,236,237,240,244,247,250,253,256,260,263],{"class":43,"line":76},[41,238,239],{"class":47},"strace",[41,241,243],{"class":242},"snvgF"," -c",[41,245,246],{"class":242}," -e",[41,248,249],{"class":57}," trace=openat,read,close,getdents64,statx",[41,251,252],{"class":57}," ls",[41,254,255],{"class":57}," \u002Fetc",[41,257,259],{"class":258},"svdQ7"," >",[41,261,262],{"class":57},"\u002Fdev\u002Fnull",[41,264,265],{"class":258}," 2>&1\n",[14,267,268],{},"Output (truncated):",[28,270,272],{"language":271},"text",[32,273,277],{"className":274,"code":276,"language":271,"meta":36},[275],"language-text","% time     seconds  usecs\u002Fcall     calls    errors syscall\n------ ----------- ----------- --------- --------- ----------------\n  0.00    0.000000           0        10           openat\n  0.00    0.000000           0        14           newfstatat\n  0.00    0.000000           0         7           getdents64\n  0.00    0.000000           0        31           close\n  100.00    0.000000                    62           total\n",[38,278,276],{"__ignoreMap":36},[14,280,281,282,285,286,289,290,293,294,293,297,300,301,304,305,308,309,312],{},"Key syscalls: ",[38,283,284],{},"openat"," (open a file), ",[38,287,288],{},"read","\u002F",[38,291,292],{},"write",", ",[38,295,296],{},"close",[38,298,299],{},"mmap"," (map file into memory), ",[38,302,303],{},"fork"," (create process), ",[38,306,307],{},"execve"," (run a program), ",[38,310,311],{},"exit"," (terminate).",[314,315,317],"h3",{"id":316},"caveat-anti-pattern-syscall-overhead-in-hot-paths","Caveat & Anti-Pattern: Syscall Overhead in Hot Paths",[28,319,320],{"language":30},[32,321,323],{"className":34,"code":322,"language":30,"meta":36,"style":36},"# NAIVE: 1 syscall per line — 1 million lines = 1 million syscalls\nwhile IFS= read -r line; do\n  printf '%s\\n' \"$line\"\ndone \u003C bigfile.txt\n# ~10 seconds for 1M lines (syscall overhead dominates)\n\n# PRODUCTION: batch I\u002FO — read in chunks, process in userspace\n# Use awk\u002Fsed (buffered I\u002FO, orders of magnitude faster)\nawk '{print}' bigfile.txt > \u002Fdev\u002Fnull\n# ~0.1 seconds for the same 1M lines — buffered read, no per-line syscall\n",[38,324,325,330,356,373,384,389,395,400,405,421],{"__ignoreMap":36},[41,326,327],{"class":43,"line":44},[41,328,329],{"class":228},"# NAIVE: 1 syscall per line — 1 million lines = 1 million syscalls\n",[41,331,332,335,338,341,344,347,350,353],{"class":43,"line":51},[41,333,334],{"class":258},"while",[41,336,337],{"class":93}," IFS",[41,339,340],{"class":258},"=",[41,342,343],{"class":242}," read",[41,345,346],{"class":242}," -r",[41,348,349],{"class":57}," line",[41,351,352],{"class":93},"; ",[41,354,355],{"class":258},"do\n",[41,357,358,361,364,367,370],{"class":43,"line":76},[41,359,360],{"class":242},"  printf",[41,362,363],{"class":57}," '%s\\n'",[41,365,366],{"class":57}," \"",[41,368,369],{"class":93},"$line",[41,371,372],{"class":57},"\"\n",[41,374,375,378,381],{"class":43,"line":82},[41,376,377],{"class":258},"done",[41,379,380],{"class":258}," \u003C",[41,382,383],{"class":93}," bigfile.txt\n",[41,385,386],{"class":43,"line":97},[41,387,388],{"class":228},"# ~10 seconds for 1M lines (syscall overhead dominates)\n",[41,390,391],{"class":43,"line":102},[41,392,394],{"emptyLinePlaceholder":393},true,"\n",[41,396,397],{"class":43,"line":128},[41,398,399],{"class":228},"# PRODUCTION: batch I\u002FO — read in chunks, process in userspace\n",[41,401,402],{"class":43,"line":133},[41,403,404],{"class":228},"# Use awk\u002Fsed (buffered I\u002FO, orders of magnitude faster)\n",[41,406,407,410,413,416,418],{"class":43,"line":159},[41,408,409],{"class":47},"awk",[41,411,412],{"class":57}," '{print}'",[41,414,415],{"class":57}," bigfile.txt",[41,417,259],{"class":258},[41,419,420],{"class":57}," \u002Fdev\u002Fnull\n",[41,422,423],{"class":43,"line":164},[41,424,425],{"class":228},"# ~0.1 seconds for the same 1M lines — buffered read, no per-line syscall\n",[14,427,428,429,431,432,434,435,293,437,293,440,293,443,446],{},"The ",[38,430,288],{}," syscall fetches one buffer at a time; the shell ",[38,433,288],{}," builtin re-enters the kernel for every line. For any I\u002FO-heavy pipeline, prefer tools that buffer (",[38,436,409],{},[38,438,439],{},"sed",[38,441,442],{},"grep",[38,444,445],{},"dd",").",[23,448,450],{"id":449},"distributions-distros","Distributions (Distros)",[14,452,453],{},"A distro = kernel + GNU tools + package manager + init system + default apps. The major families:",[455,456,457,476],"table",{},[458,459,460],"thead",{},[461,462,463,467,470,473],"tr",{},[464,465,466],"th",{},"Family",[464,468,469],{},"Examples",[464,471,472],{},"Package Manager",[464,474,475],{},"Init",[477,478,479,499,517,532,549],"tbody",{},[461,480,481,485,488,496],{},[482,483,484],"td",{},"Debian",[482,486,487],{},"Debian, Ubuntu, Mint, Pop!_OS",[482,489,490,289,493],{},[38,491,492],{},"apt",[38,494,495],{},"dpkg",[482,497,498],{},"systemd",[461,500,501,504,507,515],{},[482,502,503],{},"Red Hat",[482,505,506],{},"RHEL, Fedora, CentOS Stream, Rocky, Alma",[482,508,509,289,512],{},[38,510,511],{},"dnf",[38,513,514],{},"rpm",[482,516,498],{},[461,518,519,522,525,530],{},[482,520,521],{},"Arch",[482,523,524],{},"Arch, Manjaro, EndeavourOS",[482,526,527],{},[38,528,529],{},"pacman",[482,531,498],{},[461,533,534,537,540,547],{},[482,535,536],{},"SUSE",[482,538,539],{},"openSUSE, SLES",[482,541,542,289,545],{},[38,543,544],{},"zypper",[38,546,514],{},[482,548,498],{},[461,550,551,554,557,560],{},[482,552,553],{},"Independent",[482,555,556],{},"Gentoo, NixOS, Alpine, Void",[482,558,559],{},"portage\u002Fnix\u002Fapk\u002Fxbps",[482,561,562],{},"systemd\u002FOpenRC",[314,564,566],{"id":565},"which-distro-should-you-use","Which Distro Should You Use?",[180,568,569,575,581],{},[183,570,571,574],{},[18,572,573],{},"Server"," — Debian, Ubuntu LTS, RHEL\u002FRocky, AlmaLinux. Stability, long support.",[183,576,577,580],{},[18,578,579],{},"Learning"," — Arch Linux. You build it yourself; you understand every piece.",[183,582,583,586],{},[18,584,585],{},"Minimal\u002Fembedded"," — Alpine (5 MB), NixOS (reproducible), Void (musl).",[23,588,590],{"id":589},"check-your-system","Check Your System",[28,592,593],{"language":30},[32,594,596],{"className":34,"code":595,"language":30,"meta":36,"style":36},"# Complex Implementation: portable system identification — works across all distros\n# \u002Fetc\u002Fos-release is FHS-specified (always present); lsb_release is not\n. \u002Fetc\u002Fos-release                    # source it (sets $NAME, $VERSION_ID, etc.)\necho \"Distro: $PRETTY_NAME\"\necho \"Kernel: $(uname -r)\"\necho \"Arch:   $(uname -m)\"\necho \"Kernel build: $(uname -v)\"\n\n# Edge case: $SHELL is your LOGIN shell, not your CURRENT shell\n# If you ran `zsh` from bash, $SHELL still says \u002Fbin\u002Fbash\nps -p $$ -o comm=                   # the actual current shell\n",[38,597,598,603,608,618,631,646,660,674,678,683,688],{"__ignoreMap":36},[41,599,600],{"class":43,"line":44},[41,601,602],{"class":228},"# Complex Implementation: portable system identification — works across all distros\n",[41,604,605],{"class":43,"line":51},[41,606,607],{"class":228},"# \u002Fetc\u002Fos-release is FHS-specified (always present); lsb_release is not\n",[41,609,610,612,615],{"class":43,"line":76},[41,611,198],{"class":242},[41,613,614],{"class":57}," \u002Fetc\u002Fos-release",[41,616,617],{"class":228},"                    # source it (sets $NAME, $VERSION_ID, etc.)\n",[41,619,620,623,626,629],{"class":43,"line":82},[41,621,622],{"class":242},"echo",[41,624,625],{"class":57}," \"Distro: ",[41,627,628],{"class":93},"$PRETTY_NAME",[41,630,372],{"class":57},[41,632,633,635,638,641,643],{"class":43,"line":97},[41,634,622],{"class":242},[41,636,637],{"class":57}," \"Kernel: $(",[41,639,640],{"class":47},"uname",[41,642,346],{"class":242},[41,644,645],{"class":57},")\"\n",[41,647,648,650,653,655,658],{"class":43,"line":102},[41,649,622],{"class":242},[41,651,652],{"class":57}," \"Arch:   $(",[41,654,640],{"class":47},[41,656,657],{"class":242}," -m",[41,659,645],{"class":57},[41,661,662,664,667,669,672],{"class":43,"line":128},[41,663,622],{"class":242},[41,665,666],{"class":57}," \"Kernel build: $(",[41,668,640],{"class":47},[41,670,671],{"class":242}," -v",[41,673,645],{"class":57},[41,675,676],{"class":43,"line":133},[41,677,394],{"emptyLinePlaceholder":393},[41,679,680],{"class":43,"line":159},[41,681,682],{"class":228},"# Edge case: $SHELL is your LOGIN shell, not your CURRENT shell\n",[41,684,685],{"class":43,"line":164},[41,686,687],{"class":228},"# If you ran `zsh` from bash, $SHELL still says \u002Fbin\u002Fbash\n",[41,689,690,693,696,699,702,705],{"class":43,"line":175},[41,691,692],{"class":47},"ps",[41,694,695],{"class":242}," -p",[41,697,698],{"class":242}," $$",[41,700,701],{"class":242}," -o",[41,703,704],{"class":57}," comm=",[41,706,707],{"class":228},"                   # the actual current shell\n",[314,709,711,712,715],{"id":710},"edge-case-merged-usr-on-modern-distros","Edge Case: Merged ",[38,713,714],{},"\u002Fusr"," on Modern Distros",[14,717,718,719,722,723,726,727,722,730,733,734,737,738,741],{},"Since Debian\u002FUbuntu \"merged \u002Fusr\", ",[38,720,721],{},"\u002Fbin"," → ",[38,724,725],{},"\u002Fusr\u002Fbin"," and ",[38,728,729],{},"\u002Fsbin",[38,731,732],{},"\u002Fusr\u002Fsbin",". Scripts hardcoding ",[38,735,736],{},"\u002Fbin\u002Ffoo"," still work (symlinks), but the real path is ",[38,739,740],{},"\u002Fusr\u002Fbin\u002Ffoo",":",[28,743,744],{"language":30},[32,745,747],{"className":34,"code":746,"language":30,"meta":36,"style":36},"ls -ld \u002Fbin \u002Fsbin \u002Flib              # show the symlinks\n# lrwxrwxrwx 1 root root 7 ... \u002Fbin -> usr\u002Fbin\n# lrwxrwxrwx 1 root root 7 ... \u002Fsbin -> usr\u002Fsbin\n# lrwxrwxrwx 1 root root 7 ... \u002Flib -> usr\u002Flib\n\n# Anti-Pattern: hardcoding \u002Fbin\u002Fbash in a shebang on a non-merged distro\n# If the script is copied to an Alpine container (no \u002Fbin\u002Fbash, only \u002Fbin\u002Fsh),\n# it breaks. Use #!\u002Fusr\u002Fbin\u002Fenv bash for portability.\n",[38,748,749,769,774,779,784,788,793,798],{"__ignoreMap":36},[41,750,751,754,757,760,763,766],{"class":43,"line":44},[41,752,753],{"class":47},"ls",[41,755,756],{"class":242}," -ld",[41,758,759],{"class":57}," \u002Fbin",[41,761,762],{"class":57}," \u002Fsbin",[41,764,765],{"class":57}," \u002Flib",[41,767,768],{"class":228},"              # show the symlinks\n",[41,770,771],{"class":43,"line":51},[41,772,773],{"class":228},"# lrwxrwxrwx 1 root root 7 ... \u002Fbin -> usr\u002Fbin\n",[41,775,776],{"class":43,"line":76},[41,777,778],{"class":228},"# lrwxrwxrwx 1 root root 7 ... \u002Fsbin -> usr\u002Fsbin\n",[41,780,781],{"class":43,"line":82},[41,782,783],{"class":228},"# lrwxrwxrwx 1 root root 7 ... \u002Flib -> usr\u002Flib\n",[41,785,786],{"class":43,"line":97},[41,787,394],{"emptyLinePlaceholder":393},[41,789,790],{"class":43,"line":102},[41,791,792],{"class":228},"# Anti-Pattern: hardcoding \u002Fbin\u002Fbash in a shebang on a non-merged distro\n",[41,794,795],{"class":43,"line":128},[41,796,797],{"class":228},"# If the script is copied to an Alpine container (no \u002Fbin\u002Fbash, only \u002Fbin\u002Fsh),\n",[41,799,800],{"class":43,"line":133},[41,801,802],{"class":228},"# it breaks. Use #!\u002Fusr\u002Fbin\u002Fenv bash for portability.\n",[23,804,806],{"id":805},"the-terminal-shell-and-console","The Terminal, Shell, and Console",[180,808,809,815,821,835],{},[183,810,811,814],{},[18,812,813],{},"Terminal"," — the window\u002Fapp you type into (GNOME Terminal, Alacritty).",[183,816,817,820],{},[18,818,819],{},"Shell"," — the program that interprets commands (Bash, Zsh, Fish).",[183,822,823,826,827,830,831,834],{},[18,824,825],{},"Console"," — the physical\u002Fvirtual text interface (",[38,828,829],{},"tty1","–",[38,832,833],{},"tty6","; Ctrl+Alt+F1–F6).",[183,836,837,840,841,293,844,446],{},[18,838,839],{},"TTY"," — teletypewriter; a terminal device (",[38,842,843],{},"\u002Fdev\u002Ftty1",[38,845,846],{},"\u002Fdev\u002Fpts\u002F0",[28,848,849],{"language":30},[32,850,852],{"className":34,"code":851,"language":30,"meta":36,"style":36},"# Complex Implementation: detect if we're in a TTY, a terminal emulator, or SSH\n# — drives behavior in scripts (color, interactive prompts)\nif [ -t 1 ]; then\n  # stdout is a terminal\n  if [ \"$(tty)\" = \"not a tty\" ] 2>\u002Fdev\u002Fnull; then\n    echo \"piped\u002Fredirected\"\n  else\n    echo \"interactive: $(tty)\"\n  fi\nelse\n  echo \"stdout redirected (not a tty)\"\nfi\n\n# Detect SSH session\n[ -n \"$SSH_CONNECTION\" ] && echo \"SSH session\" || echo \"local\"\n",[38,853,854,859,864,884,889,922,930,935,946,951,956,964,970,975,981],{"__ignoreMap":36},[41,855,856],{"class":43,"line":44},[41,857,858],{"class":228},"# Complex Implementation: detect if we're in a TTY, a terminal emulator, or SSH\n",[41,860,861],{"class":43,"line":51},[41,862,863],{"class":228},"# — drives behavior in scripts (color, interactive prompts)\n",[41,865,866,869,872,875,878,881],{"class":43,"line":76},[41,867,868],{"class":258},"if",[41,870,871],{"class":93}," [ ",[41,873,874],{"class":258},"-t",[41,876,877],{"class":242}," 1",[41,879,880],{"class":93}," ]; ",[41,882,883],{"class":258},"then\n",[41,885,886],{"class":43,"line":82},[41,887,888],{"class":228},"  # stdout is a terminal\n",[41,890,891,894,896,899,902,905,908,911,914,917,920],{"class":43,"line":97},[41,892,893],{"class":258},"  if",[41,895,871],{"class":93},[41,897,898],{"class":57},"\"$(",[41,900,901],{"class":47},"tty",[41,903,904],{"class":57},")\"",[41,906,907],{"class":258}," =",[41,909,910],{"class":57}," \"not a tty\"",[41,912,913],{"class":93}," ] ",[41,915,916],{"class":258},"2>",[41,918,919],{"class":93},"\u002Fdev\u002Fnull; ",[41,921,883],{"class":258},[41,923,924,927],{"class":43,"line":102},[41,925,926],{"class":242},"    echo",[41,928,929],{"class":57}," \"piped\u002Fredirected\"\n",[41,931,932],{"class":43,"line":128},[41,933,934],{"class":258},"  else\n",[41,936,937,939,942,944],{"class":43,"line":133},[41,938,926],{"class":242},[41,940,941],{"class":57}," \"interactive: $(",[41,943,901],{"class":47},[41,945,645],{"class":57},[41,947,948],{"class":43,"line":159},[41,949,950],{"class":258},"  fi\n",[41,952,953],{"class":43,"line":164},[41,954,955],{"class":258},"else\n",[41,957,958,961],{"class":43,"line":175},[41,959,960],{"class":242},"  echo",[41,962,963],{"class":57}," \"stdout redirected (not a tty)\"\n",[41,965,967],{"class":43,"line":966},12,[41,968,969],{"class":258},"fi\n",[41,971,973],{"class":43,"line":972},13,[41,974,394],{"emptyLinePlaceholder":393},[41,976,978],{"class":43,"line":977},14,[41,979,980],{"class":228},"# Detect SSH session\n",[41,982,984,987,990,992,995,998,1001,1003,1006,1009,1012],{"class":43,"line":983},15,[41,985,986],{"class":93},"[ ",[41,988,989],{"class":258},"-n",[41,991,366],{"class":57},[41,993,994],{"class":93},"$SSH_CONNECTION",[41,996,997],{"class":57},"\"",[41,999,1000],{"class":93}," ] && ",[41,1002,622],{"class":242},[41,1004,1005],{"class":57}," \"SSH session\"",[41,1007,1008],{"class":258}," ||",[41,1010,1011],{"class":242}," echo",[41,1013,1014],{"class":57}," \"local\"\n",[23,1016,1018],{"id":1017},"the-filesystem-hierarchy-standard-fhs","The Filesystem Hierarchy Standard (FHS)",[455,1020,1021,1031],{},[458,1022,1023],{},[461,1024,1025,1028],{},[464,1026,1027],{},"Path",[464,1029,1030],{},"Contents",[477,1032,1033,1051,1071,1081,1091,1103,1116,1126,1136,1146,1161,1171,1180],{},[461,1034,1035,1041],{},[482,1036,1037,293,1039],{},[38,1038,721],{},[38,1040,725],{},[482,1042,1043,1044,293,1046,293,1048,1050],{},"User binaries (",[38,1045,753],{},[38,1047,442],{},[38,1049,30],{},")",[461,1052,1053,1059],{},[482,1054,1055,293,1057],{},[38,1056,729],{},[38,1058,732],{},[482,1060,1061,1062,293,1065,293,1068,1050],{},"System binaries (",[38,1063,1064],{},"mount",[38,1066,1067],{},"ip",[38,1069,1070],{},"systemctl",[461,1072,1073,1078],{},[482,1074,1075],{},[38,1076,1077],{},"\u002Fetc",[482,1079,1080],{},"Configuration files (text)",[461,1082,1083,1088],{},[482,1084,1085],{},[38,1086,1087],{},"\u002Fhome",[482,1089,1090],{},"User home directories",[461,1092,1093,1098],{},[482,1094,1095],{},[38,1096,1097],{},"\u002Froot",[482,1099,1100,1101,1050],{},"Root user's home (not under ",[38,1102,1087],{},[461,1104,1105,1110],{},[482,1106,1107],{},[38,1108,1109],{},"\u002Fvar",[482,1111,1112,1113,1050],{},"Variable data (logs, mail, spool, ",[38,1114,1115],{},"lib",[461,1117,1118,1123],{},[482,1119,1120],{},[38,1121,1122],{},"\u002Ftmp",[482,1124,1125],{},"Temporary files (cleared on reboot)",[461,1127,1128,1133],{},[482,1129,1130],{},[38,1131,1132],{},"\u002Fproc",[482,1134,1135],{},"Kernel\u002Fprocess info (virtual)",[461,1137,1138,1143],{},[482,1139,1140],{},[38,1141,1142],{},"\u002Fsys",[482,1144,1145],{},"Hardware\u002Fkernel info (virtual)",[461,1147,1148,1153],{},[482,1149,1150],{},[38,1151,1152],{},"\u002Fdev",[482,1154,1155,1156,293,1159,1050],{},"Device files (",[38,1157,1158],{},"\u002Fdev\u002Fsda",[38,1160,262],{},[461,1162,1163,1168],{},[482,1164,1165],{},[38,1166,1167],{},"\u002Fopt",[482,1169,1170],{},"Optional\u002Fthird-party software",[461,1172,1173,1177],{},[482,1174,1175],{},[38,1176,714],{},[482,1178,1179],{},"Read-only user data (binaries, libs, docs)",[461,1181,1182,1187],{},[482,1183,1184],{},[38,1185,1186],{},"\u002Fboot",[482,1188,1189],{},"Boot loader, kernel, initramfs",[23,1191,1193],{"id":1192},"everything-is-a-file","Everything Is a File",[14,1195,1196,1197,289,1199,1201,1202,289,1205,289,1208,289,1211,198],{},"A Unix philosophy: nearly everything is a file — regular files, directories, devices, sockets, pipes, and ",[38,1198,1132],{},[38,1200,1142],{}," kernel interfaces all use ",[38,1203,1204],{},"open()",[38,1206,1207],{},"read()",[38,1209,1210],{},"write()",[38,1212,1213],{},"close()",[28,1215,1216],{"language":30},[32,1217,1219],{"className":34,"code":1218,"language":30,"meta":36,"style":36},"# Complex Implementation: toggle a kernel parameter by writing to \u002Fproc\u002Fsys\n# — IP forwarding for a router\u002FVPN\u002FDocker host\necho 1 | sudo tee \u002Fproc\u002Fsys\u002Fnet\u002Fipv4\u002Fip_forward     # temporary (lost on reboot)\necho \"net.ipv4.ip_forward = 1\" | sudo tee \u002Fetc\u002Fsysctl.d\u002F99-ip-forward.conf  # persistent\nsudo sysctl -p \u002Fetc\u002Fsysctl.d\u002F99-ip-forward.conf     # apply without reboot\n\n# Read CPU info as a file (kernel generates content on-the-fly)\ncat \u002Fproc\u002Fcpuinfo | head -5\n\n# \u002Fdev\u002Fnull — discard sink (writes vanish, reads give EOF)\necho \"noise\" > \u002Fdev\u002Fnull\ncat \u002Fdev\u002Fnull > bigfile        # truncate bigfile to 0 bytes (common idiom)\n",[38,1220,1221,1226,1231,1252,1271,1286,1290,1295,1311,1315,1320,1331],{"__ignoreMap":36},[41,1222,1223],{"class":43,"line":44},[41,1224,1225],{"class":228},"# Complex Implementation: toggle a kernel parameter by writing to \u002Fproc\u002Fsys\n",[41,1227,1228],{"class":43,"line":51},[41,1229,1230],{"class":228},"# — IP forwarding for a router\u002FVPN\u002FDocker host\n",[41,1232,1233,1235,1237,1240,1243,1246,1249],{"class":43,"line":76},[41,1234,622],{"class":242},[41,1236,877],{"class":242},[41,1238,1239],{"class":258}," |",[41,1241,1242],{"class":47}," sudo",[41,1244,1245],{"class":57}," tee",[41,1247,1248],{"class":57}," \u002Fproc\u002Fsys\u002Fnet\u002Fipv4\u002Fip_forward",[41,1250,1251],{"class":228},"     # temporary (lost on reboot)\n",[41,1253,1254,1256,1259,1261,1263,1265,1268],{"class":43,"line":82},[41,1255,622],{"class":242},[41,1257,1258],{"class":57}," \"net.ipv4.ip_forward = 1\"",[41,1260,1239],{"class":258},[41,1262,1242],{"class":47},[41,1264,1245],{"class":57},[41,1266,1267],{"class":57}," \u002Fetc\u002Fsysctl.d\u002F99-ip-forward.conf",[41,1269,1270],{"class":228},"  # persistent\n",[41,1272,1273,1276,1279,1281,1283],{"class":43,"line":97},[41,1274,1275],{"class":47},"sudo",[41,1277,1278],{"class":57}," sysctl",[41,1280,695],{"class":242},[41,1282,1267],{"class":57},[41,1284,1285],{"class":228},"     # apply without reboot\n",[41,1287,1288],{"class":43,"line":102},[41,1289,394],{"emptyLinePlaceholder":393},[41,1291,1292],{"class":43,"line":128},[41,1293,1294],{"class":228},"# Read CPU info as a file (kernel generates content on-the-fly)\n",[41,1296,1297,1300,1303,1305,1308],{"class":43,"line":133},[41,1298,1299],{"class":47},"cat",[41,1301,1302],{"class":57}," \u002Fproc\u002Fcpuinfo",[41,1304,1239],{"class":258},[41,1306,1307],{"class":47}," head",[41,1309,1310],{"class":242}," -5\n",[41,1312,1313],{"class":43,"line":159},[41,1314,394],{"emptyLinePlaceholder":393},[41,1316,1317],{"class":43,"line":164},[41,1318,1319],{"class":228},"# \u002Fdev\u002Fnull — discard sink (writes vanish, reads give EOF)\n",[41,1321,1322,1324,1327,1329],{"class":43,"line":175},[41,1323,622],{"class":242},[41,1325,1326],{"class":57}," \"noise\"",[41,1328,259],{"class":258},[41,1330,420],{"class":57},[41,1332,1333,1335,1338,1340,1343],{"class":43,"line":966},[41,1334,1299],{"class":47},[41,1336,1337],{"class":57}," \u002Fdev\u002Fnull",[41,1339,259],{"class":258},[41,1341,1342],{"class":57}," bigfile",[41,1344,1345],{"class":228},"        # truncate bigfile to 0 bytes (common idiom)\n",[14,1347,1348,1349,1352],{},"File types (the first char of ",[38,1350,1351],{},"ls -l","):",[455,1354,1355,1365],{},[458,1356,1357],{},[461,1358,1359,1362],{},[464,1360,1361],{},"Char",[464,1363,1364],{},"Type",[477,1366,1367,1377,1387,1397,1410,1422,1431],{},[461,1368,1369,1374],{},[482,1370,1371],{},[38,1372,1373],{},"-",[482,1375,1376],{},"Regular file",[461,1378,1379,1384],{},[482,1380,1381],{},[38,1382,1383],{},"d",[482,1385,1386],{},"Directory",[461,1388,1389,1394],{},[482,1390,1391],{},[38,1392,1393],{},"l",[482,1395,1396],{},"Symbolic link",[461,1398,1399,1404],{},[482,1400,1401],{},[38,1402,1403],{},"c",[482,1405,1406,1407,1050],{},"Character device (e.g., ",[38,1408,1409],{},"\u002Fdev\u002Ftty",[461,1411,1412,1417],{},[482,1413,1414],{},[38,1415,1416],{},"b",[482,1418,1419,1420,1050],{},"Block device (e.g., ",[38,1421,1158],{},[461,1423,1424,1428],{},[482,1425,1426],{},[38,1427,14],{},[482,1429,1430],{},"Named pipe (FIFO)",[461,1432,1433,1438],{},[482,1434,1435],{},[38,1436,1437],{},"s",[482,1439,1440],{},"Socket",[28,1442,1443],{"language":30},[32,1444,1446],{"className":34,"code":1445,"language":30,"meta":36,"style":36},"# Edge Case: \u002Fproc and \u002Fsys are virtual — they exist in RAM, not on disk\nls -l \u002Fdev\u002Fsda \u002Fdev\u002Fnull \u002Fetc \u002Fproc\u002Fcpuinfo\n# brw-rw---- ... \u002Fdev\u002Fsda      (block device)\n# crw-rw-rw- ... \u002Fdev\u002Fnull     (character device)\n# drwxr-xr-x ... \u002Fetc          (directory)\n# -r--r--r-- ... \u002Fproc\u002Fcpuinfo (regular file — but virtual, generated on read)\n\n# Anti-Pattern: backing up \u002Fproc, \u002Fsys, \u002Fdev\n# du -sh \u002Fproc reports 0 or errors — it's all in-kernel\n# tar must exclude them:\n# sudo tar -czf backup.tar.gz --exclude=\u002Fproc --exclude=\u002Fsys --exclude=\u002Fdev \u002F\n",[38,1447,1448,1453,1470,1475,1480,1485,1490,1494,1499,1504,1509],{"__ignoreMap":36},[41,1449,1450],{"class":43,"line":44},[41,1451,1452],{"class":228},"# Edge Case: \u002Fproc and \u002Fsys are virtual — they exist in RAM, not on disk\n",[41,1454,1455,1457,1460,1463,1465,1467],{"class":43,"line":51},[41,1456,753],{"class":47},[41,1458,1459],{"class":242}," -l",[41,1461,1462],{"class":57}," \u002Fdev\u002Fsda",[41,1464,1337],{"class":57},[41,1466,255],{"class":57},[41,1468,1469],{"class":57}," \u002Fproc\u002Fcpuinfo\n",[41,1471,1472],{"class":43,"line":76},[41,1473,1474],{"class":228},"# brw-rw---- ... \u002Fdev\u002Fsda      (block device)\n",[41,1476,1477],{"class":43,"line":82},[41,1478,1479],{"class":228},"# crw-rw-rw- ... \u002Fdev\u002Fnull     (character device)\n",[41,1481,1482],{"class":43,"line":97},[41,1483,1484],{"class":228},"# drwxr-xr-x ... \u002Fetc          (directory)\n",[41,1486,1487],{"class":43,"line":102},[41,1488,1489],{"class":228},"# -r--r--r-- ... \u002Fproc\u002Fcpuinfo (regular file — but virtual, generated on read)\n",[41,1491,1492],{"class":43,"line":128},[41,1493,394],{"emptyLinePlaceholder":393},[41,1495,1496],{"class":43,"line":133},[41,1497,1498],{"class":228},"# Anti-Pattern: backing up \u002Fproc, \u002Fsys, \u002Fdev\n",[41,1500,1501],{"class":43,"line":159},[41,1502,1503],{"class":228},"# du -sh \u002Fproc reports 0 or errors — it's all in-kernel\n",[41,1505,1506],{"class":43,"line":164},[41,1507,1508],{"class":228},"# tar must exclude them:\n",[41,1510,1511],{"class":43,"line":175},[41,1512,1513],{"class":228},"# sudo tar -czf backup.tar.gz --exclude=\u002Fproc --exclude=\u002Fsys --exclude=\u002Fdev \u002F\n",[23,1515,1517],{"id":1516},"getting-help","Getting Help",[455,1519,1520,1530],{},[458,1521,1522],{},[461,1523,1524,1527],{},[464,1525,1526],{},"Command",[464,1528,1529],{},"Use",[477,1531,1532,1548,1561,1574,1584,1597],{},[461,1533,1534,1539],{},[482,1535,1536],{},[38,1537,1538],{},"man \u003Ccmd>",[482,1540,1541,1542,293,1545,1050],{},"Full manual (",[38,1543,1544],{},"man ls",[38,1546,1547],{},"man 5 fstab",[461,1549,1550,1555],{},[482,1551,1552],{},[38,1553,1554],{},"\u003Ccmd> --help",[482,1556,1557,1558,1050],{},"Brief help (",[38,1559,1560],{},"ls --help",[461,1562,1563,1568],{},[482,1564,1565],{},[38,1566,1567],{},"tldr \u003Ccmd>",[482,1569,1570,1571,1050],{},"Community examples (",[38,1572,1573],{},"tldr tar",[461,1575,1576,1581],{},[482,1577,1578],{},[38,1579,1580],{},"info \u003Ccmd>",[482,1582,1583],{},"GNU info pages (deeper than man for GNU tools)",[461,1585,1586,1591],{},[482,1587,1588],{},[38,1589,1590],{},"apropos \u003Ckeyword>",[482,1592,1593,1594,1050],{},"Search man pages (",[38,1595,1596],{},"apropos compress",[461,1598,1599,1604],{},[482,1600,1601],{},[38,1602,1603],{},"whatis \u003Ccmd>",[482,1605,1606,1607,1050],{},"One-line description (",[38,1608,1609],{},"whatis grep",[314,1611,1613],{"id":1612},"manual-sections","Manual Sections",[14,1615,1616,1617,1620,1621,1624],{},"Man pages are grouped into sections; use ",[38,1618,1619],{},"man 5 passwd"," (file format) vs ",[38,1622,1623],{},"man 1 passwd"," (command):",[455,1626,1627,1637],{},[458,1628,1629],{},[461,1630,1631,1634],{},[464,1632,1633],{},"Section",[464,1635,1636],{},"Content",[477,1638,1639,1647,1655,1663,1671,1679,1687,1695],{},[461,1640,1641,1644],{},[482,1642,1643],{},"1",[482,1645,1646],{},"User commands",[461,1648,1649,1652],{},[482,1650,1651],{},"2",[482,1653,1654],{},"System calls",[461,1656,1657,1660],{},[482,1658,1659],{},"3",[482,1661,1662],{},"Library functions",[461,1664,1665,1668],{},[482,1666,1667],{},"4",[482,1669,1670],{},"Special files (devices)",[461,1672,1673,1676],{},[482,1674,1675],{},"5",[482,1677,1678],{},"File formats & config",[461,1680,1681,1684],{},[482,1682,1683],{},"6",[482,1685,1686],{},"Games",[461,1688,1689,1692],{},[482,1690,1691],{},"7",[482,1693,1694],{},"Conventions, misc",[461,1696,1697,1700],{},[482,1698,1699],{},"8",[482,1701,1702],{},"System administration",[28,1704,1705],{"language":30},[32,1706,1708],{"className":34,"code":1707,"language":30,"meta":36,"style":36},"man 5 crontab     # the crontab FILE format, not the command\nman 2 open        # the open(2) SYSCALL, not any command\nman -k cron       # search for \"cron\" across all sections\n",[38,1709,1710,1724,1737],{"__ignoreMap":36},[41,1711,1712,1715,1718,1721],{"class":43,"line":44},[41,1713,1714],{"class":47},"man",[41,1716,1717],{"class":242}," 5",[41,1719,1720],{"class":57}," crontab",[41,1722,1723],{"class":228},"     # the crontab FILE format, not the command\n",[41,1725,1726,1728,1731,1734],{"class":43,"line":51},[41,1727,1714],{"class":47},[41,1729,1730],{"class":242}," 2",[41,1732,1733],{"class":57}," open",[41,1735,1736],{"class":228},"        # the open(2) SYSCALL, not any command\n",[41,1738,1739,1741,1744,1747],{"class":43,"line":76},[41,1740,1714],{"class":47},[41,1742,1743],{"class":242}," -k",[41,1745,1746],{"class":57}," cron",[41,1748,1749],{"class":228},"       # search for \"cron\" across all sections\n",[23,1751,1753],{"id":1752},"tips-tricks","💡 Tips & Tricks",[180,1755,1756,1777,1795,1803,1821],{},[183,1757,1758,1761,1762,1765,1766,1769,1770,1773,1774,1776],{},[18,1759,1760],{},"Idiom",": use ",[38,1763,1764],{},"cat \u002Fetc\u002Fos-release"," (not ",[38,1767,1768],{},"lsb_release",") for portable distro detection — ",[38,1771,1772],{},"os-release"," is FHS-specified and present on every modern distro; ",[38,1775,1768],{}," is missing on minimal installs.",[183,1778,1779,1761,1781,1765,1784,1787,1788,1791,1792,1794],{},[18,1780,1760],{},[38,1782,1783],{},"command -v \u003Cname>",[38,1785,1786],{},"which",") to check if a command exists — ",[38,1789,1790],{},"command -v"," is POSIX, built into the shell, and respects functions\u002Faliases. ",[38,1793,1786],{}," is an external command and misses shell functions.",[183,1796,1797,1761,1799,1802],{},[18,1798,1760],{},[38,1800,1801],{},"hostnamectl"," on systemd distros — shows distro, kernel, arch, hostname, and chassis type in one command.",[183,1804,1805,1808,1809,1812,1813,1816,1817,1820],{},[18,1806,1807],{},"Performance",": ",[38,1810,1811],{},"strace -c \u003Ccmd>"," reveals syscall counts — if a tool makes 10,000 ",[38,1814,1815],{},"stat"," calls, switching to a buffered alternative (like ",[38,1818,1819],{},"find -maxdepth 1",") can be 100x faster.",[183,1822,1823,1826,1827,1830],{},[18,1824,1825],{},"Portability",": Alpine uses musl, not glibc — binaries compiled against glibc (most prebuilt Linux binaries) won't run on Alpine without ",[38,1828,1829],{},"gcompat"," or a musl build. This bites Docker users pulling glibc binaries into Alpine images.",[23,1832,1834],{"id":1833},"️-edge-cases-gotchas","⚠️ Edge Cases & Gotchas",[180,1836,1837,1855,1875,1891,1917,1944],{},[183,1838,1839,1846,1847,1850,1851,1854],{},[18,1840,1841,726,1843,1845],{},[38,1842,1132],{},[38,1844,1142],{}," are virtual",": they exist in RAM, not on disk. ",[38,1848,1849],{},"du -sh \u002Fproc"," reports 0 or errors. Don't back them up. Writing to ",[38,1852,1853],{},"\u002Fproc\u002Fsys"," changes live kernel state — typos can crash the system.",[183,1856,1857,1862,1863,1866,1867,1870,1871,1874],{},[18,1858,1859,1861],{},[38,1860,262],{}," is not a regular file",": it's a character device. ",[38,1864,1865],{},"cp realfile \u002Fdev\u002Fnull"," doesn't \"save\" the file — it discards it. ",[38,1868,1869],{},"cat \u002Fdev\u002Fnull > bigfile"," truncates ",[38,1872,1873],{},"bigfile"," to 0 bytes (a common idiom).",[183,1876,1877,1882,1883,1886,1887,1890],{},[18,1878,1879,1881],{},[38,1880,1122],{}," is cleared on reboot"," (and sometimes hourly by ",[38,1884,1885],{},"systemd-tmpfiles","): don't store anything you need to keep. Use ",[38,1888,1889],{},"\u002Fvar\u002Ftmp"," for files that survive reboots (up to 30 days by default).",[183,1892,1893,1899,1900,1903,1904,293,1906,1908,1909,1912,1913,1916],{},[18,1894,1895,1898],{},[38,1896,1897],{},"$SHELL"," is your login shell, not necessarily your current shell",": if you run ",[38,1901,1902],{},"zsh"," from ",[38,1905,30],{},[38,1907,1897],{}," still says ",[38,1910,1911],{},"\u002Fbin\u002Fbash",". Use ",[38,1914,1915],{},"ps -p $$ -o comm="," for the current shell.",[183,1918,1919,1808,1928,1931,1932,1935,1936,1939,1940,1943],{},[18,1920,1921,1924,1925],{},[38,1922,1923],{},"uname -r"," vs ",[38,1926,1927],{},"uname -a",[38,1929,1930],{},"-r"," gives only the kernel release (",[38,1933,1934],{},"6.8.0-31-generic","), which is what ",[38,1937,1938],{},"apt install linux-image-$(uname -r)"," expects. ",[38,1941,1942],{},"-a"," includes hostname, kernel name, etc.",[183,1945,1946,1949,1950,1830],{},[18,1947,1948],{},"Alpine uses musl, not glibc",": binaries compiled against glibc (most prebuilt Linux binaries) won't run on Alpine without ",[38,1951,1829],{},[23,1953,1955],{"id":1954},"quick-quiz","🧠 Quick Quiz",[14,1957,1958,1959,1962,1963,1966],{},"You run ",[38,1960,1961],{},"man passwd"," and see the command documentation. You actually wanted the format of ",[38,1964,1965],{},"\u002Fetc\u002Fpasswd",". What went wrong, and how do you fix it?",[1968,1969,1970,1974,1994,2010],"details",{},[1971,1972,1973],"summary",{},"Answer",[14,1975,1976,1978,1979,1982,1983,1987,1988,1982,1990,1993],{},[38,1977,1961],{}," defaults to the lowest-numbered section with a match — section 1 (user commands), the ",[38,1980,1981],{},"passwd"," ",[1984,1985,1986],"em",{},"command",". The ",[38,1989,1965],{},[1984,1991,1992],{},"file format"," is in section 5. Fix it with:",[28,1995,1996],{"language":30},[32,1997,1999],{"className":34,"code":1998,"language":30,"meta":36,"style":36},"man 5 passwd\n",[38,2000,2001],{"__ignoreMap":36},[41,2002,2003,2005,2007],{"class":43,"line":44},[41,2004,1714],{"class":47},[41,2006,1717],{"class":242},[41,2008,2009],{"class":57}," passwd\n",[14,2011,2012,2013,2016,2017,2020,2021,2024,2025,2028,2029,2032,2033,2036,2037,2040,2041,2044],{},"This is the section-number syntax: ",[38,2014,2015],{},"man \u003Csection> \u003Cname>",". When a name exists in multiple sections, always specify the section to avoid ambiguity. Other common pairs: ",[38,2018,2019],{},"man 1 crontab"," (command) vs ",[38,2022,2023],{},"man 5 crontab"," (file), ",[38,2026,2027],{},"man 2 open"," (syscall) vs ",[38,2030,2031],{},"man 1 open"," (if a command named ",[38,2034,2035],{},"open"," exists), ",[38,2038,2039],{},"man 8 mount"," (admin command) vs ",[38,2042,2043],{},"man 2 mount"," (syscall).",[2046,2047,2048],"style",{},"html pre.shiki code .sIsaT, html code.shiki .sIsaT{--shiki-default:#6F42C1;--shiki-github-dark:#B392F0}html pre.shiki code .sJ6F3, html code.shiki .sJ6F3{--shiki-default:#032F62;--shiki-github-dark:#9ECBFF}html pre.shiki code .ssxIu, html code.shiki .ssxIu{--shiki-default:#24292E;--shiki-github-dark:#E1E4E8}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .github-dark .shiki span {color: var(--shiki-github-dark);background: var(--shiki-github-dark-bg);font-style: var(--shiki-github-dark-font-style);font-weight: var(--shiki-github-dark-font-weight);text-decoration: var(--shiki-github-dark-text-decoration);}html.github-dark .shiki span {color: var(--shiki-github-dark);background: var(--shiki-github-dark-bg);font-style: var(--shiki-github-dark-font-style);font-weight: var(--shiki-github-dark-font-weight);text-decoration: var(--shiki-github-dark-text-decoration);}html pre.shiki code .sdCPZ, html code.shiki .sdCPZ{--shiki-default:#6A737D;--shiki-github-dark:#6A737D}html pre.shiki code .snvgF, html code.shiki .snvgF{--shiki-default:#005CC5;--shiki-github-dark:#79B8FF}html pre.shiki code .svdQ7, html code.shiki .svdQ7{--shiki-default:#D73A49;--shiki-github-dark:#F97583}",{"title":36,"searchDepth":51,"depth":51,"links":2050},[2051,2052,2055,2058,2062,2063,2064,2065,2068,2069,2070],{"id":25,"depth":51,"text":26},{"id":201,"depth":51,"text":202,"children":2053},[2054],{"id":316,"depth":76,"text":317},{"id":449,"depth":51,"text":450,"children":2056},[2057],{"id":565,"depth":76,"text":566},{"id":589,"depth":51,"text":590,"children":2059},[2060],{"id":710,"depth":76,"text":2061},"Edge Case: Merged \u002Fusr on Modern Distros",{"id":805,"depth":51,"text":806},{"id":1017,"depth":51,"text":1018},{"id":1192,"depth":51,"text":1193},{"id":1516,"depth":51,"text":1517,"children":2066},[2067],{"id":1612,"depth":76,"text":1613},{"id":1752,"depth":51,"text":1753},{"id":1833,"depth":51,"text":1834},{"id":1954,"depth":51,"text":1955},"Linux is a monolithic kernel managing CPU, memory, devices, and process scheduling. Combined with GNU userspace tools, a display server, and applications, it forms a Linux distribution. This chapter covers the kernel–userspace boundary, syscall mechanics, the FHS, and the virtual filesystems that make Linux a unified system — through the lens of production code and edge-case behavior.","md",{},"\u002Flinux\u002F01-introduction-and-architecture",{"title":5,"description":2071},"linux\u002F01-introduction-and-architecture","18dNzKNb0Fj9Fd5SHHw4d5lMG_HKi0SvM2qn9gO5AO0",1789924649737]