[{"data":1,"prerenderedAt":2018},["ShallowReactive",2],{"page-\u002Flinux\u002F06-processes-and-jobs":3},{"id":4,"title":5,"body":6,"description":2011,"extension":2012,"meta":2013,"navigation":226,"path":2014,"seo":2015,"stem":2016,"__hash__":2017},"content\u002Flinux\u002F06-processes-and-jobs.md","06 — Processes & Jobs",{"type":7,"value":8,"toc":1984},"minimark",[9,13,27,32,114,160,165,260,264,270,387,394,541,561,565,665,672,720,724,884,947,951,1041,1045,1133,1137,1226,1237,1274,1350,1357,1547,1554,1636,1640,1718,1722,1822,1826,1836,1853,1856,1980],[10,11,5],"h1",{"id":12},"_06-processes-jobs",[14,15,16,17,21,22,26],"p",{},"A ",[18,19,20],"strong",{},"process"," is a running instance of a program. Linux is a multitasking, multi-user system — dozens to thousands of processes run concurrently, sharing the CPU(s). This chapter covers process lifecycle, signals, scheduling, and the ",[23,24,25],"code",{},"\u002Fproc"," interface — through the lens of production diagnostics and edge-case behavior.",[28,29,31],"h2",{"id":30},"process-lifecycle-fork-exec-exit-wait","Process Lifecycle: fork, exec, exit, wait",[33,34,36],"code-wrapper",{"language":35},"bash",[37,38,42],"pre",{"className":39,"code":40,"language":35,"meta":41,"style":41},"language-bash shiki shiki-themes github-light github-dark","# Complex Implementation: trace the fork\u002Fexec\u002Fwait cycle with strace\n# — reveals what \"running a command\" actually does at the syscall level\nstrace -f bash -c \"ls \u002Fetc >\u002Fdev\u002Fnull\" 2>&1 | grep -E \"clone|execve|wait4\"\n# clone(...) = child_pid          ← fork (Linux uses clone, not fork)\n# execve(\"\u002Fusr\u002Fbin\u002Fls\", ...) = 0  ← exec (child replaces itself with ls)\n# wait4(child_pid, ...) = ...     ← parent waits for exit status\n","",[23,43,44,53,59,96,102,108],{"__ignoreMap":41},[45,46,49],"span",{"class":47,"line":48},"line",1,[45,50,52],{"class":51},"sdCPZ","# Complex Implementation: trace the fork\u002Fexec\u002Fwait cycle with strace\n",[45,54,56],{"class":47,"line":55},2,[45,57,58],{"class":51},"# — reveals what \"running a command\" actually does at the syscall level\n",[45,60,62,66,70,74,77,80,84,87,90,93],{"class":47,"line":61},3,[45,63,65],{"class":64},"sIsaT","strace",[45,67,69],{"class":68},"snvgF"," -f",[45,71,73],{"class":72},"sJ6F3"," bash",[45,75,76],{"class":68}," -c",[45,78,79],{"class":72}," \"ls \u002Fetc >\u002Fdev\u002Fnull\"",[45,81,83],{"class":82},"svdQ7"," 2>&1",[45,85,86],{"class":82}," |",[45,88,89],{"class":64}," grep",[45,91,92],{"class":68}," -E",[45,94,95],{"class":72}," \"clone|execve|wait4\"\n",[45,97,99],{"class":47,"line":98},4,[45,100,101],{"class":51},"# clone(...) = child_pid          ← fork (Linux uses clone, not fork)\n",[45,103,105],{"class":47,"line":104},5,[45,106,107],{"class":51},"# execve(\"\u002Fusr\u002Fbin\u002Fls\", ...) = 0  ← exec (child replaces itself with ls)\n",[45,109,111],{"class":47,"line":110},6,[45,112,113],{"class":51},"# wait4(child_pid, ...) = ...     ← parent waits for exit status\n",[115,116,117,129,137,153],"ul",{},[118,119,120,125,126,128],"li",{},[18,121,122],{},[23,123,124],{},"fork()"," — child is an exact copy of the parent (memory, file descriptors, environment). Only difference: ",[23,127,124],{}," returns child PID to parent, 0 to child.",[118,130,131,136],{},[18,132,133],{},[23,134,135],{},"exec()"," — child loads a new program, replacing the copied parent code.",[118,138,139,144,145,148,149,152],{},[18,140,141],{},[23,142,143],{},"exit()"," — process terminates with a status code (0–255). Becomes a ",[18,146,147],{},"zombie"," until parent calls ",[23,150,151],{},"wait()",".",[118,154,155,159],{},[18,156,157],{},[23,158,151],{}," — parent collects exit status; zombie is reaped.",[161,162,164],"h3",{"id":163},"edge-case-zombies-and-orphans","Edge Case: Zombies and Orphans",[33,166,167],{"language":35},[37,168,170],{"className":39,"code":169,"language":35,"meta":41,"style":41},"# Complex Implementation: demonstrate zombie creation and reaping\n# — a process that dies before its parent wait()s becomes a zombie\n(\n  sleep 1 &        # child starts\n  exit 0           # parent exits immediately without waiting\n)                  # child is now an orphan (reparented to PID 1, which reaps it)\n\n# If the parent is buggy and never waits, zombies accumulate:\nps aux | awk '$8 ~ \u002FZ\u002F {print}'    # find zombies (state Z)\n# Fix: kill the parent (children get reaped by PID 1)\n",[23,171,172,177,182,188,202,213,221,228,234,254],{"__ignoreMap":41},[45,173,174],{"class":47,"line":48},[45,175,176],{"class":51},"# Complex Implementation: demonstrate zombie creation and reaping\n",[45,178,179],{"class":47,"line":55},[45,180,181],{"class":51},"# — a process that dies before its parent wait()s becomes a zombie\n",[45,183,184],{"class":47,"line":61},[45,185,187],{"class":186},"ssxIu","(\n",[45,189,190,193,196,199],{"class":47,"line":98},[45,191,192],{"class":64},"  sleep",[45,194,195],{"class":68}," 1",[45,197,198],{"class":186}," &        ",[45,200,201],{"class":51},"# child starts\n",[45,203,204,207,210],{"class":47,"line":104},[45,205,206],{"class":68},"  exit",[45,208,209],{"class":68}," 0",[45,211,212],{"class":51},"           # parent exits immediately without waiting\n",[45,214,215,218],{"class":47,"line":110},[45,216,217],{"class":186},")                  ",[45,219,220],{"class":51},"# child is now an orphan (reparented to PID 1, which reaps it)\n",[45,222,224],{"class":47,"line":223},7,[45,225,227],{"emptyLinePlaceholder":226},true,"\n",[45,229,231],{"class":47,"line":230},8,[45,232,233],{"class":51},"# If the parent is buggy and never waits, zombies accumulate:\n",[45,235,237,240,243,245,248,251],{"class":47,"line":236},9,[45,238,239],{"class":64},"ps",[45,241,242],{"class":72}," aux",[45,244,86],{"class":82},[45,246,247],{"class":64}," awk",[45,249,250],{"class":72}," '$8 ~ \u002FZ\u002F {print}'",[45,252,253],{"class":51},"    # find zombies (state Z)\n",[45,255,257],{"class":47,"line":256},10,[45,258,259],{"class":51},"# Fix: kill the parent (children get reaped by PID 1)\n",[28,261,263],{"id":262},"viewing-processes","Viewing Processes",[161,265,267,269],{"id":266},"ps-snapshot",[23,268,239],{}," — Snapshot",[33,271,272],{"language":35},[37,273,275],{"className":39,"code":274,"language":35,"meta":41,"style":41},"ps aux                      # all processes, BSD-style (most common)\nps -ef                      # all processes, System V-style\nps -e --forest              # tree view\nps -u alice                 # processes owned by alice\nps -C nginx                 # processes named nginx\nps -p 1234 -o pid,ppid,cmd  # specific PID, custom columns\nps aux --sort=-%cpu | head  # top CPU consumers\nps aux --sort=-%mem | head  # top memory consumers\n",[23,276,277,286,296,309,322,335,354,371],{"__ignoreMap":41},[45,278,279,281,283],{"class":47,"line":48},[45,280,239],{"class":64},[45,282,242],{"class":72},[45,284,285],{"class":51},"                      # all processes, BSD-style (most common)\n",[45,287,288,290,293],{"class":47,"line":55},[45,289,239],{"class":64},[45,291,292],{"class":68}," -ef",[45,294,295],{"class":51},"                      # all processes, System V-style\n",[45,297,298,300,303,306],{"class":47,"line":61},[45,299,239],{"class":64},[45,301,302],{"class":68}," -e",[45,304,305],{"class":68}," --forest",[45,307,308],{"class":51},"              # tree view\n",[45,310,311,313,316,319],{"class":47,"line":98},[45,312,239],{"class":64},[45,314,315],{"class":68}," -u",[45,317,318],{"class":72}," alice",[45,320,321],{"class":51},"                 # processes owned by alice\n",[45,323,324,326,329,332],{"class":47,"line":104},[45,325,239],{"class":64},[45,327,328],{"class":68}," -C",[45,330,331],{"class":72}," nginx",[45,333,334],{"class":51},"                 # processes named nginx\n",[45,336,337,339,342,345,348,351],{"class":47,"line":110},[45,338,239],{"class":64},[45,340,341],{"class":68}," -p",[45,343,344],{"class":68}," 1234",[45,346,347],{"class":68}," -o",[45,349,350],{"class":72}," pid,ppid,cmd",[45,352,353],{"class":51},"  # specific PID, custom columns\n",[45,355,356,358,360,363,365,368],{"class":47,"line":223},[45,357,239],{"class":64},[45,359,242],{"class":72},[45,361,362],{"class":68}," --sort=-%cpu",[45,364,86],{"class":82},[45,366,367],{"class":64}," head",[45,369,370],{"class":51},"  # top CPU consumers\n",[45,372,373,375,377,380,382,384],{"class":47,"line":230},[45,374,239],{"class":64},[45,376,242],{"class":72},[45,378,379],{"class":68}," --sort=-%mem",[45,381,86],{"class":82},[45,383,367],{"class":64},[45,385,386],{"class":51},"  # top memory consumers\n",[14,388,389,390,393],{},"The ",[23,391,392],{},"ps aux"," columns:",[33,395,396],{"language":35},[37,397,399],{"className":39,"code":398,"language":35,"meta":41,"style":41},"USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND\nroot         1  0.0  0.1 168924 13140 ?        Ss   Jun15   1:23 \u002Fsbin\u002Finit\nalice     1240  0.0  0.2  25460  5232 pts\u002F0    Ss   10:00   0:00 -bash\nalice     1305  1.2  0.8 124356 32100 pts\u002F0    S+   10:15   0:05 vim notes.md\n",[23,400,401,436,471,505],{"__ignoreMap":41},[45,402,403,406,409,412,415,418,421,424,427,430,433],{"class":47,"line":48},[45,404,405],{"class":64},"USER",[45,407,408],{"class":72},"       PID",[45,410,411],{"class":72}," %CPU",[45,413,414],{"class":72}," %MEM",[45,416,417],{"class":72},"    VSZ",[45,419,420],{"class":72},"   RSS",[45,422,423],{"class":72}," TTY",[45,425,426],{"class":72},"      STAT",[45,428,429],{"class":72}," START",[45,431,432],{"class":72},"   TIME",[45,434,435],{"class":72}," COMMAND\n",[45,437,438,441,444,447,450,453,456,459,462,465,468],{"class":47,"line":55},[45,439,440],{"class":64},"root",[45,442,443],{"class":68},"         1",[45,445,446],{"class":68},"  0.0",[45,448,449],{"class":68},"  0.1",[45,451,452],{"class":68}," 168924",[45,454,455],{"class":68}," 13140",[45,457,458],{"class":72}," ?",[45,460,461],{"class":72},"        Ss",[45,463,464],{"class":72},"   Jun15",[45,466,467],{"class":72},"   1:23",[45,469,470],{"class":72}," \u002Fsbin\u002Finit\n",[45,472,473,476,479,481,484,487,490,493,496,499,502],{"class":47,"line":61},[45,474,475],{"class":64},"alice",[45,477,478],{"class":68},"     1240",[45,480,446],{"class":68},[45,482,483],{"class":68},"  0.2",[45,485,486],{"class":68},"  25460",[45,488,489],{"class":68},"  5232",[45,491,492],{"class":72}," pts\u002F0",[45,494,495],{"class":72},"    Ss",[45,497,498],{"class":72},"   10:00",[45,500,501],{"class":72},"   0:00",[45,503,504],{"class":68}," -bash\n",[45,506,507,509,512,515,518,521,524,526,529,532,535,538],{"class":47,"line":98},[45,508,475],{"class":64},[45,510,511],{"class":68},"     1305",[45,513,514],{"class":68},"  1.2",[45,516,517],{"class":68},"  0.8",[45,519,520],{"class":68}," 124356",[45,522,523],{"class":68}," 32100",[45,525,492],{"class":72},[45,527,528],{"class":72},"    S+",[45,530,531],{"class":72},"   10:15",[45,533,534],{"class":72},"   0:05",[45,536,537],{"class":72}," vim",[45,539,540],{"class":72}," notes.md\n",[115,542,543,549,555],{},[118,544,545,548],{},[18,546,547],{},"VSZ"," — virtual memory size (KB) — address space (often large, mostly not in RAM).",[118,550,551,554],{},[18,552,553],{},"RSS"," — resident set size (KB) — actual physical memory used.",[118,556,557,560],{},[18,558,559],{},"STAT"," — process state (see below).",[161,562,564],{"id":563},"process-states","Process States",[566,567,568,581],"table",{},[569,570,571],"thead",{},[572,573,574,578],"tr",{},[575,576,577],"th",{},"Code",[575,579,580],{},"Meaning",[582,583,584,595,605,615,625,635,645,655],"tbody",{},[572,585,586,592],{},[587,588,589],"td",{},[23,590,591],{},"R",[587,593,594],{},"Running or runnable (on run queue)",[572,596,597,602],{},[587,598,599],{},[23,600,601],{},"S",[587,603,604],{},"Interruptible sleep (waiting for an event)",[572,606,607,612],{},[587,608,609],{},[23,610,611],{},"D",[587,613,614],{},"Uninterruptible sleep (usually I\u002FO — can't be killed)",[572,616,617,622],{},[587,618,619],{},[23,620,621],{},"T",[587,623,624],{},"Stopped (by signal, e.g., Ctrl+Z) or traced (debugger)",[572,626,627,632],{},[587,628,629],{},[23,630,631],{},"Z",[587,633,634],{},"Zombie (defunct — dead, not yet reaped)",[572,636,637,642],{},[587,638,639],{},[23,640,641],{},"\u003C",[587,643,644],{},"High priority (negative nice)",[572,646,647,652],{},[587,648,649],{},[23,650,651],{},"N",[587,653,654],{},"Low priority (positive nice)",[572,656,657,662],{},[587,658,659],{},[23,660,661],{},"+",[587,663,664],{},"In foreground process group",[161,666,668,669,671],{"id":667},"edge-case-the-d-state-trap","Edge Case: The ",[23,670,611],{}," State Trap",[33,673,674],{"language":35},[37,675,677],{"className":39,"code":676,"language":35,"meta":41,"style":41},"# A process in state D (uninterruptible sleep) is waiting for I\u002FO and CANNOT be killed\n# — not even with kill -9. It will exit only when the I\u002FO completes (or never, if the\n# disk\u002FNFS is truly stuck). Reboot is often the only fix.\n#\n# Typical cause: stuck NFS mount, failing disk, buggy driver\nps aux | awk '$8 ~ \u002FD\u002F'           # find D-state processes\n",[23,678,679,684,689,694,699,704],{"__ignoreMap":41},[45,680,681],{"class":47,"line":48},[45,682,683],{"class":51},"# A process in state D (uninterruptible sleep) is waiting for I\u002FO and CANNOT be killed\n",[45,685,686],{"class":47,"line":55},[45,687,688],{"class":51},"# — not even with kill -9. It will exit only when the I\u002FO completes (or never, if the\n",[45,690,691],{"class":47,"line":61},[45,692,693],{"class":51},"# disk\u002FNFS is truly stuck). Reboot is often the only fix.\n",[45,695,696],{"class":47,"line":98},[45,697,698],{"class":51},"#\n",[45,700,701],{"class":47,"line":104},[45,702,703],{"class":51},"# Typical cause: stuck NFS mount, failing disk, buggy driver\n",[45,705,706,708,710,712,714,717],{"class":47,"line":110},[45,707,239],{"class":64},[45,709,242],{"class":72},[45,711,86],{"class":82},[45,713,247],{"class":64},[45,715,716],{"class":72}," '$8 ~ \u002FD\u002F'",[45,718,719],{"class":51},"           # find D-state processes\n",[28,721,723],{"id":722},"signals","Signals",[566,725,726,742],{},[569,727,728],{},[572,729,730,733,736,739],{},[575,731,732],{},"Signal",[575,734,735],{},"Number",[575,737,738],{},"Default Action",[575,740,741],{},"Use",[582,743,744,760,776,791,806,822,838,853,869],{},[572,745,746,751,754,757],{},[587,747,748],{},[23,749,750],{},"SIGTERM",[587,752,753],{},"15",[587,755,756],{},"Terminate",[587,758,759],{},"Polite \"please stop\" (allows cleanup)",[572,761,762,767,770,773],{},[587,763,764],{},[23,765,766],{},"SIGKILL",[587,768,769],{},"9",[587,771,772],{},"Terminate (can't be caught)",[587,774,775],{},"Force kill — last resort",[572,777,778,783,786,788],{},[587,779,780],{},[23,781,782],{},"SIGINT",[587,784,785],{},"2",[587,787,756],{},[587,789,790],{},"Ctrl+C (interrupt)",[572,792,793,798,801,803],{},[587,794,795],{},[23,796,797],{},"SIGHUP",[587,799,800],{},"1",[587,802,756],{},[587,804,805],{},"\"Hang up\" — reload config (daemons)",[572,807,808,813,816,819],{},[587,809,810],{},[23,811,812],{},"SIGSTOP",[587,814,815],{},"19",[587,817,818],{},"Stop (can't be caught)",[587,820,821],{},"Suspend (Ctrl+Z sends SIGTSTP, catchable)",[572,823,824,829,832,835],{},[587,825,826],{},[23,827,828],{},"SIGCONT",[587,830,831],{},"18",[587,833,834],{},"Continue",[587,836,837],{},"Resume a stopped process",[572,839,840,845,848,850],{},[587,841,842],{},[23,843,844],{},"SIGUSR1",[587,846,847],{},"10",[587,849,756],{},[587,851,852],{},"User-defined (e.g., nginx reopens logs)",[572,854,855,860,863,866],{},[587,856,857],{},[23,858,859],{},"SIGSEGV",[587,861,862],{},"11",[587,864,865],{},"Core dump",[587,867,868],{},"Segmentation fault (bad memory access)",[572,870,871,876,879,881],{},[587,872,873],{},[23,874,875],{},"SIGPIPE",[587,877,878],{},"13",[587,880,756],{},[587,882,883],{},"Writing to a pipe with no reader",[33,885,886],{"language":35},[37,887,889],{"className":39,"code":888,"language":35,"meta":41,"style":41},"kill -l                  # list all signals\nkill 1234                # send SIGTERM (15) to PID 1234\nkill -9 1234             # SIGKILL (force — no cleanup)\nkill -HUP 1234           # SIGHUP (reload)\nkill -0 1234             # check if process exists (no signal sent)\n",[23,890,891,902,911,923,935],{"__ignoreMap":41},[45,892,893,896,899],{"class":47,"line":48},[45,894,895],{"class":68},"kill",[45,897,898],{"class":68}," -l",[45,900,901],{"class":51},"                  # list all signals\n",[45,903,904,906,908],{"class":47,"line":55},[45,905,895],{"class":68},[45,907,344],{"class":68},[45,909,910],{"class":51},"                # send SIGTERM (15) to PID 1234\n",[45,912,913,915,918,920],{"class":47,"line":61},[45,914,895],{"class":68},[45,916,917],{"class":68}," -9",[45,919,344],{"class":68},[45,921,922],{"class":51},"             # SIGKILL (force — no cleanup)\n",[45,924,925,927,930,932],{"class":47,"line":98},[45,926,895],{"class":68},[45,928,929],{"class":68}," -HUP",[45,931,344],{"class":68},[45,933,934],{"class":51},"           # SIGHUP (reload)\n",[45,936,937,939,942,944],{"class":47,"line":104},[45,938,895],{"class":68},[45,940,941],{"class":68}," -0",[45,943,344],{"class":68},[45,945,946],{"class":51},"             # check if process exists (no signal sent)\n",[161,948,950],{"id":949},"caveat-anti-pattern-sigterm-vs-sigkill","Caveat & Anti-Pattern: SIGTERM vs SIGKILL",[33,952,953],{"language":35},[37,954,956],{"className":39,"code":955,"language":35,"meta":41,"style":41},"# NAIVE: kill -9 immediately (no cleanup, databases may need recovery)\nkill -9 1234\n\n# PRODUCTION: SIGTERM first, wait, then SIGKILL only if needed\nkill 1234                    # SIGTERM — allows graceful shutdown\nsleep 5                      # give it time to clean up\nkill -0 1234 2>\u002Fdev\u002Fnull && kill -9 1234   # still alive? force kill\n\n# Edge Case: D-state processes ignore even SIGKILL\n# kill -9 \u003CD-state-pid> → no effect (process is in uninterruptible I\u002FO wait)\n",[23,957,958,963,972,976,981,990,1001,1027,1031,1036],{"__ignoreMap":41},[45,959,960],{"class":47,"line":48},[45,961,962],{"class":51},"# NAIVE: kill -9 immediately (no cleanup, databases may need recovery)\n",[45,964,965,967,969],{"class":47,"line":55},[45,966,895],{"class":68},[45,968,917],{"class":68},[45,970,971],{"class":68}," 1234\n",[45,973,974],{"class":47,"line":61},[45,975,227],{"emptyLinePlaceholder":226},[45,977,978],{"class":47,"line":98},[45,979,980],{"class":51},"# PRODUCTION: SIGTERM first, wait, then SIGKILL only if needed\n",[45,982,983,985,987],{"class":47,"line":104},[45,984,895],{"class":68},[45,986,344],{"class":68},[45,988,989],{"class":51},"                    # SIGTERM — allows graceful shutdown\n",[45,991,992,995,998],{"class":47,"line":110},[45,993,994],{"class":64},"sleep",[45,996,997],{"class":68}," 5",[45,999,1000],{"class":51},"                      # give it time to clean up\n",[45,1002,1003,1005,1007,1009,1012,1015,1018,1020,1022,1024],{"class":47,"line":223},[45,1004,895],{"class":68},[45,1006,941],{"class":68},[45,1008,344],{"class":68},[45,1010,1011],{"class":82}," 2>",[45,1013,1014],{"class":72},"\u002Fdev\u002Fnull",[45,1016,1017],{"class":186}," && ",[45,1019,895],{"class":68},[45,1021,917],{"class":68},[45,1023,344],{"class":68},[45,1025,1026],{"class":51},"   # still alive? force kill\n",[45,1028,1029],{"class":47,"line":230},[45,1030,227],{"emptyLinePlaceholder":226},[45,1032,1033],{"class":47,"line":236},[45,1034,1035],{"class":51},"# Edge Case: D-state processes ignore even SIGKILL\n",[45,1037,1038],{"class":47,"line":256},[45,1039,1040],{"class":51},"# kill -9 \u003CD-state-pid> → no effect (process is in uninterruptible I\u002FO wait)\n",[28,1042,1044],{"id":1043},"job-control","Job Control",[33,1046,1047],{"language":35},[37,1048,1050],{"className":39,"code":1049,"language":35,"meta":41,"style":41},"# Complex Implementation: parallel jobs with exit-code capture\nsleep 100 &             # background (prints [1] 12345 — job 1, PID 12345)\nvim notes.md            # foreground (shell blocks)\nCtrl+Z                  # suspend vim → \"Stopped\", shell returns\nbg                      # resume vim in background\njobs                    # list background jobs\nfg %1                   # bring job 1 to foreground\nkill %1                 # send SIGTERM to job 1\nwait                    # wait for all background jobs\n",[23,1051,1052,1057,1070,1081,1089,1097,1105,1116,1125],{"__ignoreMap":41},[45,1053,1054],{"class":47,"line":48},[45,1055,1056],{"class":51},"# Complex Implementation: parallel jobs with exit-code capture\n",[45,1058,1059,1061,1064,1067],{"class":47,"line":55},[45,1060,994],{"class":64},[45,1062,1063],{"class":68}," 100",[45,1065,1066],{"class":186}," &             ",[45,1068,1069],{"class":51},"# background (prints [1] 12345 — job 1, PID 12345)\n",[45,1071,1072,1075,1078],{"class":47,"line":61},[45,1073,1074],{"class":64},"vim",[45,1076,1077],{"class":72}," notes.md",[45,1079,1080],{"class":51},"            # foreground (shell blocks)\n",[45,1082,1083,1086],{"class":47,"line":98},[45,1084,1085],{"class":64},"Ctrl+Z",[45,1087,1088],{"class":51},"                  # suspend vim → \"Stopped\", shell returns\n",[45,1090,1091,1094],{"class":47,"line":104},[45,1092,1093],{"class":68},"bg",[45,1095,1096],{"class":51},"                      # resume vim in background\n",[45,1098,1099,1102],{"class":47,"line":110},[45,1100,1101],{"class":68},"jobs",[45,1103,1104],{"class":51},"                    # list background jobs\n",[45,1106,1107,1110,1113],{"class":47,"line":223},[45,1108,1109],{"class":68},"fg",[45,1111,1112],{"class":72}," %1",[45,1114,1115],{"class":51},"                   # bring job 1 to foreground\n",[45,1117,1118,1120,1122],{"class":47,"line":230},[45,1119,895],{"class":68},[45,1121,1112],{"class":72},[45,1123,1124],{"class":51},"                 # send SIGTERM to job 1\n",[45,1126,1127,1130],{"class":47,"line":236},[45,1128,1129],{"class":68},"wait",[45,1131,1132],{"class":51},"                    # wait for all background jobs\n",[161,1134,1136],{"id":1135},"keeping-jobs-after-logout","Keeping Jobs After Logout",[33,1138,1139],{"language":35},[37,1140,1142],{"className":39,"code":1141,"language":35,"meta":41,"style":41},"# Background jobs receive SIGHUP when the shell exits, killing them.\n# To survive:\nnohup long-task > log.txt 2>&1 &   # immune to SIGHUP (output → nohup.out)\nlong-task & disown                 # remove from shell's job table\nsetsid long-task &                # start in a new session (detached)\ntmux new -d -s work 'long-task'   # run in tmux (survives logout, reattachable)\n",[23,1143,1144,1149,1154,1176,1190,1203],{"__ignoreMap":41},[45,1145,1146],{"class":47,"line":48},[45,1147,1148],{"class":51},"# Background jobs receive SIGHUP when the shell exits, killing them.\n",[45,1150,1151],{"class":47,"line":55},[45,1152,1153],{"class":51},"# To survive:\n",[45,1155,1156,1159,1162,1165,1168,1170,1173],{"class":47,"line":61},[45,1157,1158],{"class":64},"nohup",[45,1160,1161],{"class":72}," long-task",[45,1163,1164],{"class":82}," >",[45,1166,1167],{"class":72}," log.txt",[45,1169,83],{"class":82},[45,1171,1172],{"class":186}," &   ",[45,1174,1175],{"class":51},"# immune to SIGHUP (output → nohup.out)\n",[45,1177,1178,1181,1184,1187],{"class":47,"line":98},[45,1179,1180],{"class":64},"long-task",[45,1182,1183],{"class":186}," & ",[45,1185,1186],{"class":68},"disown",[45,1188,1189],{"class":51},"                 # remove from shell's job table\n",[45,1191,1192,1195,1197,1200],{"class":47,"line":104},[45,1193,1194],{"class":64},"setsid",[45,1196,1161],{"class":72},[45,1198,1199],{"class":186}," &                ",[45,1201,1202],{"class":51},"# start in a new session (detached)\n",[45,1204,1205,1208,1211,1214,1217,1220,1223],{"class":47,"line":110},[45,1206,1207],{"class":64},"tmux",[45,1209,1210],{"class":72}," new",[45,1212,1213],{"class":68}," -d",[45,1215,1216],{"class":68}," -s",[45,1218,1219],{"class":72}," work",[45,1221,1222],{"class":72}," 'long-task'",[45,1224,1225],{"class":51},"   # run in tmux (survives logout, reattachable)\n",[28,1227,1229,1230,1233,1234],{"id":1228},"process-priority-nice-and-renice","Process Priority: ",[23,1231,1232],{},"nice"," and ",[23,1235,1236],{},"renice",[566,1238,1239,1249],{},[569,1240,1241],{},[572,1242,1243,1246],{},[575,1244,1245],{},"Nice",[575,1247,1248],{},"Priority",[582,1250,1251,1259,1267],{},[572,1252,1253,1256],{},[587,1254,1255],{},"-20",[587,1257,1258],{},"Highest (needs root to set)",[572,1260,1261,1264],{},[587,1262,1263],{},"0",[587,1265,1266],{},"Default",[572,1268,1269,1271],{},[587,1270,815],{},[587,1272,1273],{},"Lowest (runs only when CPU is idle)",[33,1275,1276],{"language":35},[37,1277,1279],{"className":39,"code":1278,"language":35,"meta":41,"style":41},"# Complex Implementation: low-priority backup job (CPU + I\u002FO)\nnice -n 19 ionice -c 3 tar -czf backup.tar.gz \u002Fhome\n# nice: low CPU priority\n# ionice -c 3: idle I\u002FO class (only uses disk when no one else does)\n# Prevents the backup from disrupting interactive work\n\nrenice -n 5 -p 1234     # change running process to nice 5\n",[23,1280,1281,1286,1316,1321,1326,1331,1335],{"__ignoreMap":41},[45,1282,1283],{"class":47,"line":48},[45,1284,1285],{"class":51},"# Complex Implementation: low-priority backup job (CPU + I\u002FO)\n",[45,1287,1288,1290,1293,1296,1299,1301,1304,1307,1310,1313],{"class":47,"line":55},[45,1289,1232],{"class":64},[45,1291,1292],{"class":68}," -n",[45,1294,1295],{"class":68}," 19",[45,1297,1298],{"class":72}," ionice",[45,1300,76],{"class":68},[45,1302,1303],{"class":68}," 3",[45,1305,1306],{"class":72}," tar",[45,1308,1309],{"class":68}," -czf",[45,1311,1312],{"class":72}," backup.tar.gz",[45,1314,1315],{"class":72}," \u002Fhome\n",[45,1317,1318],{"class":47,"line":61},[45,1319,1320],{"class":51},"# nice: low CPU priority\n",[45,1322,1323],{"class":47,"line":98},[45,1324,1325],{"class":51},"# ionice -c 3: idle I\u002FO class (only uses disk when no one else does)\n",[45,1327,1328],{"class":47,"line":104},[45,1329,1330],{"class":51},"# Prevents the backup from disrupting interactive work\n",[45,1332,1333],{"class":47,"line":110},[45,1334,227],{"emptyLinePlaceholder":226},[45,1336,1337,1339,1341,1343,1345,1347],{"class":47,"line":223},[45,1338,1236],{"class":64},[45,1340,1292],{"class":68},[45,1342,997],{"class":68},[45,1344,341],{"class":68},[45,1346,344],{"class":68},[45,1348,1349],{"class":51},"     # change running process to nice 5\n",[28,1351,1353,1356],{"id":1352},"procpid-process-internals",[23,1354,1355],{},"\u002Fproc\u002F\u003Cpid>\u002F"," — Process Internals",[33,1358,1359],{"language":35},[37,1360,1362],{"className":39,"code":1361,"language":35,"meta":41,"style":41},"# Complex Implementation: inspect a running process without ps or top\npid=$(pgrep -x nginx | head -1)\ncat \u002Fproc\u002F$pid\u002Fstatus | head -10     # human-readable status\ncat \u002Fproc\u002F$pid\u002Fcmdline | tr '\\0' ' ' # command line (null-separated)\nls -l \u002Fproc\u002F$pid\u002Fcwd                 # working directory (symlink)\nls -l \u002Fproc\u002F$pid\u002Fexe                 # executable (symlink)\nls -l \u002Fproc\u002F$pid\u002Ffd\u002F                 # open file descriptors\ncat \u002Fproc\u002F$pid\u002Fenviron | tr '\\0' '\\n' # environment variables\ncat \u002Fproc\u002F$pid\u002Fio                     # I\u002FO counters (read\u002Fwrite bytes)\ncat \u002Fproc\u002F$pid\u002Flimits                 # resource limits (ulimits)\n",[23,1363,1364,1369,1398,1422,1447,1464,1480,1496,1519,1533],{"__ignoreMap":41},[45,1365,1366],{"class":47,"line":48},[45,1367,1368],{"class":51},"# Complex Implementation: inspect a running process without ps or top\n",[45,1370,1371,1374,1377,1380,1383,1386,1388,1390,1392,1395],{"class":47,"line":55},[45,1372,1373],{"class":186},"pid",[45,1375,1376],{"class":82},"=",[45,1378,1379],{"class":186},"$(",[45,1381,1382],{"class":64},"pgrep",[45,1384,1385],{"class":68}," -x",[45,1387,331],{"class":72},[45,1389,86],{"class":82},[45,1391,367],{"class":64},[45,1393,1394],{"class":68}," -1",[45,1396,1397],{"class":186},")\n",[45,1399,1400,1403,1406,1409,1412,1414,1416,1419],{"class":47,"line":61},[45,1401,1402],{"class":64},"cat",[45,1404,1405],{"class":72}," \u002Fproc\u002F",[45,1407,1408],{"class":186},"$pid",[45,1410,1411],{"class":72},"\u002Fstatus",[45,1413,86],{"class":82},[45,1415,367],{"class":64},[45,1417,1418],{"class":68}," -10",[45,1420,1421],{"class":51},"     # human-readable status\n",[45,1423,1424,1426,1428,1430,1433,1435,1438,1441,1444],{"class":47,"line":98},[45,1425,1402],{"class":64},[45,1427,1405],{"class":72},[45,1429,1408],{"class":186},[45,1431,1432],{"class":72},"\u002Fcmdline",[45,1434,86],{"class":82},[45,1436,1437],{"class":64}," tr",[45,1439,1440],{"class":72}," '\\0'",[45,1442,1443],{"class":72}," ' '",[45,1445,1446],{"class":51}," # command line (null-separated)\n",[45,1448,1449,1452,1454,1456,1458,1461],{"class":47,"line":104},[45,1450,1451],{"class":64},"ls",[45,1453,898],{"class":68},[45,1455,1405],{"class":72},[45,1457,1408],{"class":186},[45,1459,1460],{"class":72},"\u002Fcwd",[45,1462,1463],{"class":51},"                 # working directory (symlink)\n",[45,1465,1466,1468,1470,1472,1474,1477],{"class":47,"line":110},[45,1467,1451],{"class":64},[45,1469,898],{"class":68},[45,1471,1405],{"class":72},[45,1473,1408],{"class":186},[45,1475,1476],{"class":72},"\u002Fexe",[45,1478,1479],{"class":51},"                 # executable (symlink)\n",[45,1481,1482,1484,1486,1488,1490,1493],{"class":47,"line":223},[45,1483,1451],{"class":64},[45,1485,898],{"class":68},[45,1487,1405],{"class":72},[45,1489,1408],{"class":186},[45,1491,1492],{"class":72},"\u002Ffd\u002F",[45,1494,1495],{"class":51},"                 # open file descriptors\n",[45,1497,1498,1500,1502,1504,1507,1509,1511,1513,1516],{"class":47,"line":230},[45,1499,1402],{"class":64},[45,1501,1405],{"class":72},[45,1503,1408],{"class":186},[45,1505,1506],{"class":72},"\u002Fenviron",[45,1508,86],{"class":82},[45,1510,1437],{"class":64},[45,1512,1440],{"class":72},[45,1514,1515],{"class":72}," '\\n'",[45,1517,1518],{"class":51}," # environment variables\n",[45,1520,1521,1523,1525,1527,1530],{"class":47,"line":236},[45,1522,1402],{"class":64},[45,1524,1405],{"class":72},[45,1526,1408],{"class":186},[45,1528,1529],{"class":72},"\u002Fio",[45,1531,1532],{"class":51},"                     # I\u002FO counters (read\u002Fwrite bytes)\n",[45,1534,1535,1537,1539,1541,1544],{"class":47,"line":256},[45,1536,1402],{"class":64},[45,1538,1405],{"class":72},[45,1540,1408],{"class":186},[45,1542,1543],{"class":72},"\u002Flimits",[45,1545,1546],{"class":51},"                 # resource limits (ulimits)\n",[28,1548,1550,1553],{"id":1549},"lsof-list-open-files",[23,1551,1552],{},"lsof"," — List Open Files",[33,1555,1556],{"language":35},[37,1557,1559],{"className":39,"code":1558,"language":35,"meta":41,"style":41},"# Complex Implementation: diagnose \"disk full but df doesn't show it\"\n# — a process holds a large deleted file open (space not freed until fd closes)\nsudo lsof +L1               # list open files with link count 0 (deleted but open)\n# COMMAND   PID  USER  FD  SIZE  NLINK  NAME\n# nginx    1234  root  9w  50G   0      \u002Fvar\u002Flog\u002Fnginx\u002Faccess.log (deleted)\n\n# Fix: restart the process (closes the fd, frees the space)\nsudo systemctl restart nginx\n# Or truncate the file via \u002Fproc (without restarting):\nsudo truncate -s 0 \u002Fproc\u002F1234\u002Ffd\u002F9\n",[23,1560,1561,1566,1571,1585,1590,1595,1599,1604,1617,1622],{"__ignoreMap":41},[45,1562,1563],{"class":47,"line":48},[45,1564,1565],{"class":51},"# Complex Implementation: diagnose \"disk full but df doesn't show it\"\n",[45,1567,1568],{"class":47,"line":55},[45,1569,1570],{"class":51},"# — a process holds a large deleted file open (space not freed until fd closes)\n",[45,1572,1573,1576,1579,1582],{"class":47,"line":61},[45,1574,1575],{"class":64},"sudo",[45,1577,1578],{"class":72}," lsof",[45,1580,1581],{"class":72}," +L1",[45,1583,1584],{"class":51},"               # list open files with link count 0 (deleted but open)\n",[45,1586,1587],{"class":47,"line":98},[45,1588,1589],{"class":51},"# COMMAND   PID  USER  FD  SIZE  NLINK  NAME\n",[45,1591,1592],{"class":47,"line":104},[45,1593,1594],{"class":51},"# nginx    1234  root  9w  50G   0      \u002Fvar\u002Flog\u002Fnginx\u002Faccess.log (deleted)\n",[45,1596,1597],{"class":47,"line":110},[45,1598,227],{"emptyLinePlaceholder":226},[45,1600,1601],{"class":47,"line":223},[45,1602,1603],{"class":51},"# Fix: restart the process (closes the fd, frees the space)\n",[45,1605,1606,1608,1611,1614],{"class":47,"line":230},[45,1607,1575],{"class":64},[45,1609,1610],{"class":72}," systemctl",[45,1612,1613],{"class":72}," restart",[45,1615,1616],{"class":72}," nginx\n",[45,1618,1619],{"class":47,"line":236},[45,1620,1621],{"class":51},"# Or truncate the file via \u002Fproc (without restarting):\n",[45,1623,1624,1626,1629,1631,1633],{"class":47,"line":256},[45,1625,1575],{"class":64},[45,1627,1628],{"class":72}," truncate",[45,1630,1216],{"class":68},[45,1632,209],{"class":68},[45,1634,1635],{"class":72}," \u002Fproc\u002F1234\u002Ffd\u002F9\n",[28,1637,1639],{"id":1638},"tips-tricks","💡 Tips & Tricks",[115,1641,1642,1660,1668,1679,1698,1710],{},[118,1643,1644,1647,1648,1651,1652,1655,1656,1659],{},[18,1645,1646],{},"Idiom",": use ",[23,1649,1650],{},"pgrep -a"," (not ",[23,1653,1654],{},"ps aux | grep",") to find processes by name — ",[23,1657,1658],{},"pgrep -a nginx"," lists PID + full command, no grep self-match, no noise.",[118,1661,1662,1647,1664,1667],{},[18,1663,1646],{},[23,1665,1666],{},"pkill -HUP \u003Cname>"," to reload daemon config — many daemons (nginx, sshd) reload their config on SIGHUP without dropping connections.",[118,1669,1670,1647,1672,1675,1676,152],{},[18,1671,1646],{},[23,1673,1674],{},"kill -0 $PID"," to check if a process exists — sends no signal, just returns 0 if the PID exists. ",[23,1677,1678],{},"kill -0 $pid 2>\u002Fdev\u002Fnull && echo \"running\" || echo \"stopped\"",[118,1680,1681,1647,1683,1686,1687,1690,1691,1693,1694,1697],{},[18,1682,1646],{},[23,1684,1685],{},"nice -n 19 ionice -c3"," for non-urgent heavy jobs — backup, ",[23,1688,1689],{},"find \u002F",", indexing. ",[23,1692,1232],{}," lowers CPU priority, ",[23,1695,1696],{},"ionice -c3"," lowers I\u002FO priority.",[118,1699,1700,1647,1703,1233,1706,1709],{},[18,1701,1702],{},"Debug",[23,1704,1705],{},"\u002Fproc\u002F\u003Cpid>\u002Ffd",[23,1707,1708],{},"lsof -p \u003Cpid>"," to see what a process is doing — open files reveal what it's reading\u002Fwriting, sockets reveal network connections.",[118,1711,1712,1647,1714,1717],{},[18,1713,1702],{},[23,1715,1716],{},"ls -l \u002Fproc\u002F\u003Cpid>\u002Fcwd"," to find a process's working directory — essential when a daemon's relative paths break.",[28,1719,1721],{"id":1720},"️-edge-cases-gotchas","⚠️ Edge Cases & Gotchas",[115,1723,1724,1736,1748,1760,1786,1806],{},[118,1725,1726,1732,1733,1735],{},[18,1727,1728,1731],{},[23,1729,1730],{},"kill -9"," (SIGKILL) gives no cleanup",": the process can't flush buffers, close files cleanly, or notify peers. Databases may need recovery on next start. Always try ",[23,1734,895],{}," (SIGTERM) first.",[118,1737,1738,1744,1745,1747],{},[18,1739,1740,1741,1743],{},"State ",[23,1742,611],{}," processes can't be killed",": a process in uninterruptible sleep (I\u002FO wait) ignores even ",[23,1746,1730],{},". It will exit when the I\u002FO completes — or never, if the disk\u002FNFS is truly stuck.",[118,1749,1750,1753,1754,1756,1757,1759],{},[18,1751,1752],{},"Zombies persist until reaped",": a dead process (state ",[23,1755,631],{},") remains in the process table until its parent calls ",[23,1758,151],{},". Fix the parent or kill the parent (children get reaped by PID 1).",[118,1761,1762,1768,1769,1772,1773,1777,1778,1781,1782,1785],{},[18,1763,1764,1767],{},[23,1765,1766],{},"pkill -f"," can kill unintended processes",": ",[23,1770,1771],{},"pkill -f python"," matches ",[1774,1775,1776],"em",{},"any"," command line containing \"python\" — including ",[23,1779,1780],{},"vim python_notes.md",". Use ",[23,1783,1784],{},"pgrep -af"," first to preview.",[118,1787,1788,1797,1798,1801,1802,1805],{},[18,1789,1790,1793,1794,1796],{},[23,1791,1792],{},"%CPU"," in ",[23,1795,239],{}," is lifetime average, not current",": a process that spiked for 1 second and ran for 100 seconds shows ~1%. Use ",[23,1799,1800],{},"top","\u002F",[23,1803,1804],{},"htop"," for current CPU usage.",[118,1807,1808,1768,1811,1814,1815,1817,1818,1821],{},[18,1809,1810],{},"Nice doesn't affect I\u002FO or memory",[23,1812,1813],{},"nice -n 19"," only reduces CPU priority. An I\u002FO-heavy task still hammers the disk. Use ",[23,1816,1696],{}," for I\u002FO and ",[23,1819,1820],{},"cgroups"," for memory.",[28,1823,1825],{"id":1824},"spot-the-bug","🧠 Spot the Bug",[14,1827,1828,1829,1832,1833,1835],{},"A sysadmin wants to kill a runaway ",[23,1830,1831],{},"python"," process, but this command kills their ",[23,1834,1074],{}," session too:",[33,1837,1838],{"language":35},[37,1839,1841],{"className":39,"code":1840,"language":35,"meta":41,"style":41},"pkill -f python\n",[23,1842,1843],{"__ignoreMap":41},[45,1844,1845,1848,1850],{"class":47,"line":48},[45,1846,1847],{"class":64},"pkill",[45,1849,69],{"class":68},[45,1851,1852],{"class":72}," python\n",[14,1854,1855],{},"What happened, and how do you fix it?",[1857,1858,1859,1863,1883,1888,1907,1916,1932,1939,1969],"details",{},[1860,1861,1862],"summary",{},"Answer",[14,1864,1865,1867,1868,1871,1872,1875,1876,1879,1880,1882],{},[23,1866,1766],{}," matches the ",[18,1869,1870],{},"full command line",", not just the process name. The sysadmin was editing ",[23,1873,1874],{},"python_server.py"," in vim — vim's command line is ",[23,1877,1878],{},"vim python_server.py",", which contains \"python.\" So ",[23,1881,1771],{}," matched and killed vim.",[14,1884,1885],{},[18,1886,1887],{},"Fix 1 — match the process name only:",[33,1889,1890],{"language":35},[37,1891,1893],{"className":39,"code":1892,"language":35,"meta":41,"style":41},"pkill -x python3    # exact match on process name (comm), not command line\n",[23,1894,1895],{"__ignoreMap":41},[45,1896,1897,1899,1901,1904],{"class":47,"line":48},[45,1898,1847],{"class":64},[45,1900,1385],{"class":68},[45,1902,1903],{"class":72}," python3",[45,1905,1906],{"class":51},"    # exact match on process name (comm), not command line\n",[14,1908,1909],{},[18,1910,1911,1912,1915],{},"Fix 2 — be specific with ",[23,1913,1914],{},"-f",":",[33,1917,1918],{"language":35},[37,1919,1921],{"className":39,"code":1920,"language":35,"meta":41,"style":41},"pkill -f \"python3 app.py\"\n",[23,1922,1923],{"__ignoreMap":41},[45,1924,1925,1927,1929],{"class":47,"line":48},[45,1926,1847],{"class":64},[45,1928,69],{"class":68},[45,1930,1931],{"class":72}," \"python3 app.py\"\n",[14,1933,1934],{},[18,1935,1936,1937,1915],{},"Fix 3 — preview first with ",[23,1938,1382],{},[33,1940,1941],{"language":35},[37,1942,1944],{"className":39,"code":1943,"language":35,"meta":41,"style":41},"pgrep -af python    # see what WOULD be killed (PID + full command)\n# 1234 python3 app.py\n# 5678 vim python_server.py   ← oops, this would be killed\n",[23,1945,1946,1959,1964],{"__ignoreMap":41},[45,1947,1948,1950,1953,1956],{"class":47,"line":48},[45,1949,1382],{"class":64},[45,1951,1952],{"class":68}," -af",[45,1954,1955],{"class":72}," python",[45,1957,1958],{"class":51},"    # see what WOULD be killed (PID + full command)\n",[45,1960,1961],{"class":47,"line":55},[45,1962,1963],{"class":51},"# 1234 python3 app.py\n",[45,1965,1966],{"class":47,"line":61},[45,1967,1968],{"class":51},"# 5678 vim python_server.py   ← oops, this would be killed\n",[14,1970,1971,1972,1975,1976,1979],{},"Always run ",[23,1973,1974],{},"pgrep -af \u003Cpattern>"," before ",[23,1977,1978],{},"pkill -f \u003Cpattern>"," to verify the match set.",[1981,1982,1983],"style",{},"html pre.shiki code .sdCPZ, html code.shiki .sdCPZ{--shiki-default:#6A737D;--shiki-github-dark:#6A737D}html pre.shiki code .sIsaT, html code.shiki .sIsaT{--shiki-default:#6F42C1;--shiki-github-dark:#B392F0}html pre.shiki code .snvgF, html code.shiki .snvgF{--shiki-default:#005CC5;--shiki-github-dark:#79B8FF}html pre.shiki code .sJ6F3, html code.shiki .sJ6F3{--shiki-default:#032F62;--shiki-github-dark:#9ECBFF}html pre.shiki code .svdQ7, html code.shiki .svdQ7{--shiki-default:#D73A49;--shiki-github-dark:#F97583}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 .ssxIu, html code.shiki .ssxIu{--shiki-default:#24292E;--shiki-github-dark:#E1E4E8}",{"title":41,"searchDepth":55,"depth":55,"links":1985},[1986,1989,1996,1999,2002,2004,2006,2008,2009,2010],{"id":30,"depth":55,"text":31,"children":1987},[1988],{"id":163,"depth":61,"text":164},{"id":262,"depth":55,"text":263,"children":1990},[1991,1993,1994],{"id":266,"depth":61,"text":1992},"ps — Snapshot",{"id":563,"depth":61,"text":564},{"id":667,"depth":61,"text":1995},"Edge Case: The D State Trap",{"id":722,"depth":55,"text":723,"children":1997},[1998],{"id":949,"depth":61,"text":950},{"id":1043,"depth":55,"text":1044,"children":2000},[2001],{"id":1135,"depth":61,"text":1136},{"id":1228,"depth":55,"text":2003},"Process Priority: nice and renice",{"id":1352,"depth":55,"text":2005},"\u002Fproc\u002F\u003Cpid>\u002F — Process Internals",{"id":1549,"depth":55,"text":2007},"lsof — List Open Files",{"id":1638,"depth":55,"text":1639},{"id":1720,"depth":55,"text":1721},{"id":1824,"depth":55,"text":1825},"A process is a running instance of a program. Linux is a multitasking, multi-user system — dozens to thousands of processes run concurrently, sharing the CPU(s). This chapter covers process lifecycle, signals, scheduling, and the \u002Fproc interface — through the lens of production diagnostics and edge-case behavior.","md",{},"\u002Flinux\u002F06-processes-and-jobs",{"title":5,"description":2011},"linux\u002F06-processes-and-jobs","Xts9NbVVIrF6PCtYlLtI46nAVLDCdXo2Q1ss06FiBCQ",1789924649939]