[{"data":1,"prerenderedAt":388},["ShallowReactive",2],{"mdc--hur95-key":3,"mdc--zcz32j-key":46,"mdc--n49wg0-key":102,"mdc-vom1n4-key":111,"mdc-843bll-key":182,"mdc-dkdyl6-key":194,"mdc-gm00b-key":264,"mdc--efzhfe-key":353,"mdc--nsaly0-key":373},{"data":4,"body":5},{},{"type":6,"children":7},"root",[8,24],{"type":9,"tag":10,"props":11,"children":12},"element","p",{},[13,16,22],{"type":14,"value":15},"text","When you open a terminal, you are not talking to Linux. You are talking to a program that talks to Linux on your behalf. That program is called a ",{"type":9,"tag":17,"props":18,"children":19},"strong",{},[20],{"type":14,"value":21},"shell",{"type":14,"value":23},".",{"type":9,"tag":10,"props":25,"children":26},{},[27,29,36,38,44],{"type":14,"value":28},"This distinction sounds pedantic, but it explains almost everything that confuses beginners — why ",{"type":9,"tag":30,"props":31,"children":33},"code",{"className":32},[],[34],{"type":14,"value":35},"cd",{"type":14,"value":37}," behaves differently from ",{"type":9,"tag":30,"props":39,"children":41},{"className":40},[],[42],{"type":14,"value":43},"ls",{"type":14,"value":45},", why a command works in one terminal and not another, and why the error message you get is sometimes from the shell and sometimes from the program you tried to run.",{"data":47,"body":48},{},{"type":6,"children":49},[50,57,76],{"type":9,"tag":51,"props":52,"children":54},"h2",{"id":53},"the-terminal-and-the-shell-are-different-things",[55],{"type":14,"value":56},"The terminal and the shell are different things",{"type":9,"tag":10,"props":58,"children":59},{},[60,62,67,69,75],{"type":14,"value":61},"The ",{"type":9,"tag":17,"props":63,"children":64},{},[65],{"type":14,"value":66},"terminal",{"type":14,"value":68}," is the window. It draws text on your screen and collects your keystrokes. Historically it was a physical device — a keyboard and a screen wired to a computer somewhere else. The window on your desktop is emulating that hardware, which is why it's properly called a ",{"type":9,"tag":70,"props":71,"children":72},"em",{},[73],{"type":14,"value":74},"terminal emulator",{"type":14,"value":23},{"type":9,"tag":10,"props":77,"children":78},{},[79,80,84,86,92,94,100],{"type":14,"value":61},{"type":9,"tag":17,"props":81,"children":82},{},[83],{"type":14,"value":21},{"type":14,"value":85}," is the program running inside that window. It reads what you type, works out what you meant, runs it, and prints the result. On most Linux systems the default shell is ",{"type":9,"tag":30,"props":87,"children":89},{"className":88},[],[90],{"type":14,"value":91},"bash",{"type":14,"value":93},"; on modern macOS it's ",{"type":9,"tag":30,"props":95,"children":97},{"className":96},[],[98],{"type":14,"value":99},"zsh",{"type":14,"value":101},". They're different programs that happen to speak an almost identical language.",{"data":103,"body":104},{},{"type":6,"children":105},[106],{"type":9,"tag":107,"props":108,"children":110},"terminal-teaser",{":lines":109},"[{\"cmd\":\"echo $SHELL\",\"out\":\"/bin/bash\"},{\"cmd\":\"whoami\",\"out\":\"you\"},{\"cmd\":\"date\",\"out\":\"Wed Aug 19 09:14:22 UTC 2026\"}]",[],{"data":112,"body":113},{},{"type":6,"children":114},[115,121,126,139,158,170],{"type":9,"tag":51,"props":116,"children":118},{"id":117},"the-read-evaluate-print-loop",[119],{"type":14,"value":120},"The read-evaluate-print loop",{"type":9,"tag":10,"props":122,"children":123},{},[124],{"type":14,"value":125},"Everything a shell does fits in one sentence: it prints a prompt, waits for a line, runs it, and repeats.",{"type":9,"tag":10,"props":127,"children":128},{},[129,131,137],{"type":14,"value":130},"That prompt — usually ending in ",{"type":9,"tag":30,"props":132,"children":134},{"className":133},[],[135],{"type":14,"value":136},"$",{"type":14,"value":138}," — is the shell telling you it is ready. When a command is running, the prompt disappears; when it comes back, the command has finished. Learning to read that rhythm is most of what \"being comfortable at the terminal\" means.",{"type":9,"tag":10,"props":140,"children":141},{},[142,144,149,151,156],{"type":14,"value":143},"When you type a line and press enter, the shell splits it into words. The first word is the ",{"type":9,"tag":17,"props":145,"children":146},{},[147],{"type":14,"value":148},"command",{"type":14,"value":150},". Everything after it is an ",{"type":9,"tag":17,"props":152,"children":153},{},[154],{"type":14,"value":155},"argument",{"type":14,"value":157},":",{"type":9,"tag":159,"props":160,"children":164},"pre",{"className":161,"code":163,"language":14},[162],"language-text","ls -l /etc\n│  │   │\n│  │   └── argument: which directory to list\n│  └────── option (also an argument, but it modifies behaviour)\n└───────── command: the program to run\n",[165],{"type":9,"tag":30,"props":166,"children":168},{"__ignoreMap":167},"",[169],{"type":14,"value":163},{"type":9,"tag":10,"props":171,"children":172},{},[173,175,180],{"type":14,"value":174},"The shell then looks for a program with that name, hands it the arguments, and gets out of the way. The output you see is usually printed by the ",{"type":9,"tag":70,"props":176,"children":177},{},[178],{"type":14,"value":179},"program",{"type":14,"value":181},", not the shell.",{"data":183,"body":184},{},{"type":6,"children":185},[186],{"type":9,"tag":187,"props":188,"children":193},"quiz",{":answer":189,":options":190,"explanation":191,"question":192},"0","[\"The `cat` program, because it was the thing that tried and failed to open the file\",\"The shell, because it checks that files exist before running anything\",\"The Linux kernel, printing directly to your screen\"]","The shell only found and launched `cat`. It doesn't know or care what arguments mean. `cat` took \"notes.txt\", asked the kernel to open it, was told it doesn't exist, and printed the complaint itself.","You type `cat notes.txt` and see \"No such file or directory\". Who printed that message?",[],{"data":195,"body":196},{},{"type":6,"children":197},[198,204,231,244,253],{"type":9,"tag":51,"props":199,"children":201},{"id":200},"where-commands-come-from",[202],{"type":14,"value":203},"Where commands come from",{"type":9,"tag":10,"props":205,"children":206},{},[207,209,214,216,222,224,229],{"type":14,"value":208},"Most commands are just files on disk. ",{"type":9,"tag":30,"props":210,"children":212},{"className":211},[],[213],{"type":14,"value":43},{"type":14,"value":215}," is a real program sitting at ",{"type":9,"tag":30,"props":217,"children":219},{"className":218},[],[220],{"type":14,"value":221},"/usr/bin/ls",{"type":14,"value":223},". When you type ",{"type":9,"tag":30,"props":225,"children":227},{"className":226},[],[228],{"type":14,"value":43},{"type":14,"value":230},", the shell searches a list of directories for something by that name, and runs the first match it finds.",{"type":9,"tag":10,"props":232,"children":233},{},[234,236,242],{"type":14,"value":235},"That list lives in a variable called ",{"type":9,"tag":30,"props":237,"children":239},{"className":238},[],[240],{"type":14,"value":241},"PATH",{"type":14,"value":243},". You can see it:",{"type":9,"tag":159,"props":245,"children":248},{"className":246,"code":247,"language":14},[162],"echo $PATH\n/usr/local/bin:/usr/bin:/bin:/usr/local/games\n",[249],{"type":9,"tag":30,"props":250,"children":251},{"__ignoreMap":167},[252],{"type":14,"value":247},{"type":9,"tag":10,"props":254,"children":255},{},[256,258,263],{"type":14,"value":257},"The colons separate directories. The shell checks them left to right. This is why \"command not found\" almost never means the program is missing — it usually means it exists somewhere that isn't on your ",{"type":9,"tag":30,"props":259,"children":261},{"className":260},[],[262],{"type":14,"value":241},{"type":14,"value":23},{"data":265,"body":266},{},{"type":6,"children":267},[268],{"type":9,"tag":269,"props":270,"children":272},"deep-dive",{"title":271},"So why is `cd` different?",[273,285,332,344],{"type":9,"tag":10,"props":274,"children":275},{},[276,278,283],{"type":14,"value":277},"Because ",{"type":9,"tag":30,"props":279,"children":281},{"className":280},[],[282],{"type":14,"value":35},{"type":14,"value":284}," is not a file anywhere. It's built into the shell itself.",{"type":9,"tag":10,"props":286,"children":287},{},[288,290,295,297,302,304,309,311,317,318,324,326,331],{"type":14,"value":289},"It has to be. Changing directory changes the state of the shell process. If ",{"type":9,"tag":30,"props":291,"children":293},{"className":292},[],[294],{"type":14,"value":35},{"type":14,"value":296}," were a separate program, it would change ",{"type":9,"tag":70,"props":298,"children":299},{},[300],{"type":14,"value":301},"its own",{"type":14,"value":303}," directory, then exit — leaving the shell exactly where it started. A handful of commands work this way for the same reason: ",{"type":9,"tag":30,"props":305,"children":307},{"className":306},[],[308],{"type":14,"value":35},{"type":14,"value":310},", ",{"type":9,"tag":30,"props":312,"children":314},{"className":313},[],[315],{"type":14,"value":316},"export",{"type":14,"value":310},{"type":9,"tag":30,"props":319,"children":321},{"className":320},[],[322],{"type":14,"value":323},"exit",{"type":14,"value":325},", and a few others are called ",{"type":9,"tag":17,"props":327,"children":328},{},[329],{"type":14,"value":330},"builtins",{"type":14,"value":23},{"type":9,"tag":10,"props":333,"children":334},{},[335,337,343],{"type":14,"value":336},"You can check which is which with ",{"type":9,"tag":30,"props":338,"children":340},{"className":339},[],[341],{"type":14,"value":342},"type",{"type":14,"value":157},{"type":9,"tag":159,"props":345,"children":348},{"className":346,"code":347,"language":14},[162],"type ls\nls is /usr/bin/ls\n\ntype cd\ncd is a shell builtin\n",[349],{"type":9,"tag":30,"props":350,"children":351},{"__ignoreMap":167},[352],{"type":14,"value":347},{"data":354,"body":355},{},{"type":6,"children":356},[357,363,368],{"type":9,"tag":51,"props":358,"children":360},{"id":359},"why-this-is-worth-your-time",[361],{"type":14,"value":362},"Why this is worth your time",{"type":9,"tag":10,"props":364,"children":365},{},[366],{"type":14,"value":367},"You can use a computer for years without touching a shell. But every server you will ever ssh into, every Docker container you will ever debug, and every CI pipeline you will ever fix is a text interface with no GUI available. The command line isn't nostalgia — it's the only interface that exists in the places software actually runs.",{"type":9,"tag":10,"props":369,"children":370},{},[371],{"type":14,"value":372},"It is also the fastest one. A GUI can only offer what someone designed a button for. A shell lets you combine small programs in ways nobody anticipated, which is what the last lesson of this course is about.",{"data":374,"body":375},{},{"type":6,"children":376},[377,383],{"type":9,"tag":187,"props":378,"children":382},{":answer":189,":options":379,"explanation":380,"question":381},"[\"A list of directories the shell searches for programs\",\"A list of every command installed on the system\",\"The directory you are currently in\"]","It's a colon-separated list of directories, searched left to right. The first matching program wins — which is also how you can shadow a system command with your own version.","What does `PATH` actually contain?",[],{"type":9,"tag":10,"props":384,"children":385},{},[386],{"type":14,"value":387},"Next up: moving around the filesystem, which is where almost all your time at the prompt is spent.",1787908866326]