{"course":{"slug":"building-apps-with-ai","title":"Building Apps with AI","url":"https://addaly.com/learn/building-apps-with-ai","level":"beginner","track":"build"},"lesson":{"slug":"the-terminal-without-fear","title":"The terminal, for people who have been avoiding it","url":"https://addaly.com/learn/building-apps-with-ai/the-terminal-without-fear","position":6,"of":87,"minutes":8,"answer":"A terminal is either waiting for you or busy; read the last ten lines of any failure, and check the path in any command that deletes or force-pushes before agreeing to it.","keyIdea":"A terminal is either waiting for you or busy; read the last ten lines of any failure, and check the path in any command that deletes or force-pushes before agreeing to it."},"body":{"format":"markdown","text":"## It is a text box that runs one thing at a time\n\nThe terminal has a reputation it does not deserve. It shows you a **prompt**, you type a command, it runs, it prints something, and it gives you the prompt back. That is the whole interaction.\n\nThe two states matter more than the commands. When you can see the prompt, nothing is running and it is waiting for you. When you cannot, something is running and typing will not help. People spend a surprising amount of time typing into a terminal that is busy.\n\nTo stop whatever is running: **Ctrl+C**. On every platform, including a Mac. Not Cmd+C, which copies.\n\n## Six commands and two keys\n\n```bash\npwd                 # which folder am I in\nls                  # what is in it (dir on Windows CMD)\ncd projects/salon   # go into a folder\ncd ..               # go up one\ncat package.json    # print a file to the screen\nclear               # clean up the mess\n```\n\nThe two keys do more than the commands. **Tab** completes what you are typing: type `cd pro` and press Tab. **Up arrow** brings back your previous commands, so you rarely type anything twice.\n\nWhen you get `command not found`, it means exactly what it says: the shell looked through its list of places (`$PATH`) and there was nothing by that name. Either it is not installed, or your terminal was open before you installed it. Open a new terminal first: that fixes it more often than anything else.\n\n## The four you will actually run all day\n\n```bash\nnpm install         # download what this project needs\nnpm run dev         # start the development server\nnpm run build       # make the production version\nnpm test            # run the tests, if any exist\n```\n\n`npm run` on its own lists everything a project defines. That list lives in the `scripts` section of `package.json`, and reading it is the fastest way to learn how an unfamiliar project is meant to be operated.\n\n## Reading output, which is the actual skill\n\nA failing command usually prints between 20 and 400 lines. Almost none of it matters.\n\n- The **last** ten lines contain the failure. Scroll to the bottom first, always.\n- Warnings are not errors. `npm install` routinely prints a dozen deprecation warnings and works perfectly.\n- The first line mentioning **your own** file path is where to look. Everything mentioning `node_modules` is a library's internals.\n- A number after a colon, like `route.ts:23:31`, is line 23, character 31.\n\nWhen you copy an error to paste somewhere, copy the command you ran as well as the error. Half the answer is usually in the command.\n\n## Two mistakes everybody makes once\n\n**Running npm in the wrong folder.** You get an error about no `package.json`, or npm cheerfully creates one where it does not belong. `pwd` before you install, every time, until it becomes automatic.\n\n**Assuming a stopped server is a broken server.** You closed the terminal, so `localhost:3000` is dead. Nothing is wrong. The dev server only runs while its terminal is open.\n\n## Commands to look at twice\n\nAn agent will sometimes propose a command with real consequences. You do not need to memorise shell syntax to spot the dangerous shapes:\n\n- `rm -rf` deletes a folder and everything under it, with no bin to recover from. Read the path that follows it, character by character, before agreeing.\n- `git push --force` can overwrite work on the server, including somebody else's.\n- `git reset --hard` throws away uncommitted changes permanently.\n- Anything piping a downloaded script straight into a shell (`curl … | bash`) runs code you have not read as you.\n- `sudo` runs as administrator. Legitimate for installing system packages, and rarely needed for anything inside a project.\n\nIf a tool proposes one of these and you do not understand it, the correct move is to ask *what exactly will this delete or overwrite* and wait for an answer.\n\n## Free ways to make it pleasant\n\nThe default shell is fine, and you can improve it for nothing. **zsh** with **oh-my-zsh** gives you better completion and a prompt that shows your git branch, which quietly prevents a whole category of mistake. **fzf** searches your command history. **tmux** keeps a session alive when your terminal closes.\n\nNone of it is required. Tab and the up arrow will carry you a long way."},"check":{"question":"A build fails and prints 300 lines. Where should you read first?","options":[{"text":"The first lines, since the earliest problem causes the ones that follow.","correct":false,"tempting":"Applies compiler intuition to tool output; build tools print configuration and warnings at the top and the actual failure at the bottom."},{"text":"Any line coloured red, wherever it appears.","correct":false,"tempting":"Colour marks severity inconsistently across tools, and deprecation warnings are frequently red while the fatal line is not."},{"text":"The lines mentioning node_modules, where the failing library lives.","correct":false,"tempting":"Points at library internals, which is where the crash surfaced rather than where your mistake is."},{"text":"The last ten lines, then the first line above them naming a file of your own.","correct":true}]},"prev":{"slug":"a-machine-that-can-build","title":"Getting a machine that can actually build","url":"https://addaly.com/learn/building-apps-with-ai/a-machine-that-can-build"},"next":{"slug":"choosing-a-stack-and-stopping","title":"Choosing a stack, and then stopping","url":"https://addaly.com/learn/building-apps-with-ai/choosing-a-stack-and-stopping"},"authorship":"Founder and series editor: Dr Mustafa Mun. Written by AI models to a written standard. Exam keys checked blind by a second model: 3,665 of 3,666 agreed. Academic review invited.","review":{"status":"Draft, open for academic review"},"cite":"Addaly (2026) 'The terminal, for people who have been avoiding it', in Building Apps with AI. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/building-apps-with-ai/the-terminal-without-fear (Accessed: 13 October 2026).","licence":{"name":"CC BY-NC-SA 4.0","url":"https://creativecommons.org/licenses/by-nc-sa/4.0/"},"reader":{"schema":1,"title":"The terminal, for people who have been avoiding it","courseTitle":"Building Apps with AI","module":{"index":1,"slug":"the-machine-and-the-model","title":"The machine, and what the model can see of it"},"answer":null,"keyIdea":"A terminal is either waiting for you or busy; read the last ten lines of any failure, and check the path in any command that deletes or force-pushes before agreeing to it.","hero":{"kind":"plate","image":null,"alt":null,"caption":null},"blocks":[{"t":"h2","id":"it-is-a-text-box-that-runs-one-thing-at-a-time","runs":[{"text":"It is a text box that runs one thing at a time"}]},{"t":"p","runs":[{"text":"The terminal has a reputation it does not deserve. It shows you a "},{"text":"prompt","b":true},{"text":", you type a command, it runs, it prints something, and it gives you the prompt back. That is the whole interaction."}]},{"t":"p","runs":[{"text":"The two states matter more than the commands. When you can see the prompt, nothing is running and it is waiting for you. When you cannot, something is running and typing will not help. People spend a surprising amount of time typing into a terminal that is busy."}]},{"t":"p","runs":[{"text":"To stop whatever is running: "},{"text":"Ctrl+C","b":true},{"text":". On every platform, including a Mac. Not Cmd+C, which copies."}]},{"t":"h2","id":"six-commands-and-two-keys","runs":[{"text":"Six commands and two keys"}]},{"t":"code","lang":"bash","label":"Bash","text":"pwd                 # which folder am I in\nls                  # what is in it (dir on Windows CMD)\ncd projects/salon   # go into a folder\ncd ..               # go up one\ncat package.json    # print a file to the screen\nclear               # clean up the mess"},{"t":"p","runs":[{"text":"The two keys do more than the commands. "},{"text":"Tab","b":true},{"text":" completes what you are typing: type "},{"text":"cd pro","code":true},{"text":" and press Tab. "},{"text":"Up arrow","b":true},{"text":" brings back your previous commands, so you rarely type anything twice."}]},{"t":"p","runs":[{"text":"When you get "},{"text":"command not found","code":true},{"text":", it means exactly what it says: the shell looked through its list of places ("},{"text":"$PATH","code":true},{"text":") and there was nothing by that name. Either it is not installed, or your terminal was open before you installed it. Open a new terminal first: that fixes it more often than anything else."}]},{"t":"h2","id":"the-four-you-will-actually-run-all-day","runs":[{"text":"The four you will actually run all day"}]},{"t":"code","lang":"bash","label":"Bash","text":"npm install         # download what this project needs\nnpm run dev         # start the development server\nnpm run build       # make the production version\nnpm test            # run the tests, if any exist"},{"t":"p","runs":[{"text":"npm run","code":true},{"text":" on its own lists everything a project defines. That list lives in the "},{"text":"scripts","code":true},{"text":" section of "},{"text":"package.json","code":true},{"text":", and reading it is the fastest way to learn how an unfamiliar project is meant to be operated."}]},{"t":"h2","id":"reading-output-which-is-the-actual-skill","runs":[{"text":"Reading output, which is the actual skill"}]},{"t":"p","runs":[{"text":"A failing command usually prints between 20 and 400 lines. Almost none of it matters."}]},{"t":"ul","items":[[{"text":"The "},{"text":"last","b":true},{"text":" ten lines contain the failure. Scroll to the bottom first, always."}],[{"text":"Warnings are not errors. "},{"text":"npm install","code":true},{"text":" routinely prints a dozen deprecation warnings and works perfectly."}],[{"text":"The first line mentioning "},{"text":"your own","b":true},{"text":" file path is where to look. Everything mentioning "},{"text":"node_modules","code":true},{"text":" is a library’s internals."}],[{"text":"A number after a colon, like "},{"text":"route.ts:23:31","code":true},{"text":", is line 23, character 31."}]]},{"t":"p","runs":[{"text":"When you copy an error to paste somewhere, copy the command you ran as well as the error. Half the answer is usually in the command."}]},{"t":"h2","id":"two-mistakes-everybody-makes-once","runs":[{"text":"Two mistakes everybody makes once"}]},{"t":"p","runs":[{"text":"Running npm in the wrong folder.","b":true},{"text":" You get an error about no "},{"text":"package.json","code":true},{"text":", or npm cheerfully creates one where it does not belong. "},{"text":"pwd","code":true},{"text":" before you install, every time, until it becomes automatic."}]},{"t":"p","runs":[{"text":"Assuming a stopped server is a broken server.","b":true},{"text":" You closed the terminal, so "},{"text":"localhost:3000","code":true},{"text":" is dead. Nothing is wrong. The dev server only runs while its terminal is open."}]},{"t":"h2","id":"commands-to-look-at-twice","runs":[{"text":"Commands to look at twice"}]},{"t":"p","runs":[{"text":"An agent will sometimes propose a command with real consequences. You do not need to memorise shell syntax to spot the dangerous shapes:"}]},{"t":"ul","items":[[{"text":"rm -rf","code":true},{"text":" deletes a folder and everything under it, with no bin to recover from. Read the path that follows it, character by character, before agreeing."}],[{"text":"git push --force","code":true},{"text":" can overwrite work on the server, including somebody else’s."}],[{"text":"git reset --hard","code":true},{"text":" throws away uncommitted changes permanently."}],[{"text":"Anything piping a downloaded script straight into a shell ("},{"text":"curl … | bash","code":true},{"text":") runs code you have not read as you."}],[{"text":"sudo","code":true},{"text":" runs as administrator. Legitimate for installing system packages, and rarely needed for anything inside a project."}]]},{"t":"p","runs":[{"text":"If a tool proposes one of these and you do not understand it, the correct move is to ask "},{"text":"what exactly will this delete or overwrite","i":true},{"text":" and wait for an answer."}]},{"t":"h2","id":"free-ways-to-make-it-pleasant","runs":[{"text":"Free ways to make it pleasant"}]},{"t":"p","runs":[{"text":"The default shell is fine, and you can improve it for nothing. "},{"text":"zsh","b":true},{"text":" with "},{"text":"oh-my-zsh","b":true},{"text":" gives you better completion and a prompt that shows your git branch, which quietly prevents a whole category of mistake. "},{"text":"fzf","b":true},{"text":" searches your command history. "},{"text":"tmux","b":true},{"text":" keeps a session alive when your terminal closes."}]},{"t":"p","runs":[{"text":"None of it is required. Tab and the up arrow will carry you a long way."}]}],"check":{"question":[{"text":"A build fails and prints 300 lines. Where should you read first?"}],"options":[{"text":[{"text":"The first lines, since the earliest problem causes the ones that follow."}],"correct":false,"tempting":[{"text":"Applies compiler intuition to tool output; build tools print configuration and warnings at the top and the actual failure at the bottom."}]},{"text":[{"text":"Any line coloured red, wherever it appears."}],"correct":false,"tempting":[{"text":"Colour marks severity inconsistently across tools, and deprecation warnings are frequently red while the fatal line is not."}]},{"text":[{"text":"The lines mentioning node_modules, where the failing library lives."}],"correct":false,"tempting":[{"text":"Points at library internals, which is where the crash surfaced rather than where your mistake is."}]},{"text":[{"text":"The last ten lines, then the first line above them naming a file of your own."}],"correct":true,"tempting":null}],"order":[1,0,3,2],"why":null},"prev":{"slug":"a-machine-that-can-build","title":"Getting a machine that can actually build","minutes":9},"next":{"slug":"choosing-a-stack-and-stopping","title":"Choosing a stack, and then stopping","minutes":8}}}