{"course":{"slug":"ai-careers","title":"Working in AI","url":"https://addaly.com/learn/ai-careers","level":"beginner","track":"work"},"lesson":{"slug":"the-command-line-and-the-free-tier","title":"The terminal, the container, and a cloud bill of zero","url":"https://addaly.com/learn/ai-careers/the-command-line-and-the-free-tier","position":26,"of":85,"minutes":10,"answer":"Cloud costs are dominated by resources that bill for existing rather than for working, so set a budget alert first and prefer things that scale to zero.","keyIdea":"Cloud costs are dominated by resources that bill for existing rather than for working, so set a budget alert first and prefer things that scale to zero."},"body":{"format":"markdown","text":"## Where notebooks stop\n\nAlmost every course teaches you inside a notebook. Almost every job eventually puts you on a machine that has no notebook, no graphical interface and no mouse: a server, a container, a continuous-integration runner. The gap between those two worlds ends more early careers than any missing algorithm.\n\nThe good news is that the gap is small and closes in a fortnight.\n\n## Twenty commands cover most of it\n\n`cd` `ls` `pwd` `cat` `less` `head` `tail` `grep` `find` `wc` `sort` `uniq` `cut` `sed` `awk` `chmod` `ssh` `scp` `curl` `tar`, plus `df` and `du` when a disk fills and `ps`/`kill` when something will not stop.\n\nThe reason these are worth learning is that they compose. A single line answers a question that would otherwise be a twenty-minute script:\n\n```bash\ngrep ERROR app.log | awk '{print $5}' | sort | uniq -c | sort -rn | head\n```\n\nRead it right to left: find the error lines, take the fifth field, sort them together, count each distinct value, sort those counts descending, show the top ten. That is the most common diagnostic in operational work and it runs on a log file of any size that fits on disk.\n\nTwo habits make the shell survivable. Keep a plain text file of commands you had to look up: after two months you will stop consulting it, and the writing is what made that happen. And run `history | grep <word>` to find what you did last Tuesday, because you did not remember it either.\n\n## Environments, and why \"it works on my machine\"\n\nPython's default behaviour installs packages globally, so two projects fight over one version of a library and eventually somebody's code stops running. The fix takes ten seconds:\n\n```bash\npython -m venv .venv\nsource .venv/bin/activate      # Windows: .venv\\Scripts\\activate\npip install -r requirements.txt\npip freeze > requirements.txt\n```\n\n`uv` is a newer, much faster, free tool that does the same thing and is worth adopting. Whichever you use, the rule is that a project states its dependencies in a file that is committed, and a stranger can reproduce your environment from that file alone. If they cannot, your portfolio project does not run for the reviewer, and a project that does not run is not evidence.\n\n## Containers, in one page\n\nA container packages your code with its operating-system dependencies so it behaves identically wherever it runs. A complete, useful Dockerfile:\n\n```dockerfile\nFROM python:3.12-slim\nWORKDIR /app\nCOPY requirements.txt .\nRUN pip install --no-cache-dir -r requirements.txt\nCOPY . .\nCMD [\"python\", \"main.py\"]\n```\n\nTwo commands run it: `docker build -t myapp .` then `docker run myapp`. That is most of what a junior needs. Docker Desktop is free for personal use and small companies; Podman and Colima are free alternatives with no licence conditions at all.\n\n## SSH, briefly\n\nGenerate a key once with `ssh-keygen -t ed25519`, put the public half on the server and on GitHub, and never type a password again. The private key never leaves your machine and never goes in a repository: a leaked key is an incident, and scanners find them within minutes of a public commit.\n\n## The free tier, and the bill that surprises people\n\nYou can do all of this at no cost. Cloud providers have free tiers; Oracle Cloud and Google Cloud both offer small always-free virtual machines, GitHub Actions gives free minutes on public repositories, and Colab and Kaggle give free GPU hours that are enough to train real models at small scale. A second-hand laptop running Linux, or WSL on Windows, is a complete environment.\n\nThe bills that catch people are not compute-hours spent doing work. They are resources that bill for **existing**:\n\n> Figure: What a forgotten resource costs in a month. Bars (US dollars per month): GPU instance stopped but not terminated, one long weekend 240; Small managed database, nobody connected 40; NAT gateway a tutorial created silently 32; Object storage for a 5 GB project 0.12; Serverless function at portfolio traffic 0. The bill is for existing, not for working. Compute you actually used is rarely the surprise; a database nobody connects to and a GPU that was stopped rather than terminated are. Set a budget alert before creating anything, and prefer things that scale to zero.\n\n- A managed database left running: a small one is roughly $15 to $60 a month, forever, whether or not anything connects to it.\n- A NAT gateway, which many tutorials create silently: about $30 a month plus data charges.\n- **Egress** (data leaving the cloud) charged per gigabyte, which is how a \"small\" export becomes a real number.\n- A GPU instance you stopped using but did not terminate. At a few dollars an hour, a forgotten weekend is a few hundred dollars.\n\nTwo defences, both free and both taking five minutes. Set a billing alert and a budget on the day you create the account, before you create anything else. And prefer things that scale to zero (serverless functions, object storage, a container that runs on a schedule) over anything that runs continuously.\n\n## The limitation\n\nNone of this is intellectually difficult and all of it is unfamiliar, which is a worse problem, because unfamiliarity feels like inability. Expect two weeks of looking things up constantly. That is the normal cost, not a signal about you."},"check":{"question":"A learner follows a tutorial, deploys a small demo, uses it twice, and receives a $94 bill the next month despite almost no traffic. What is the most likely explanation?","options":[{"text":"The demo was attacked or scraped, generating request volume they did not see.","correct":false,"tempting":"Assumes usage drove the bill, when the pattern of a near-idle service costing tens of dollars points at resources charged by the hour regardless of use."},{"text":"Free tier limits were exceeded because free tiers only cover the first month.","correct":false,"tempting":"Misstates how free tiers work; most are ongoing monthly allowances, and exceeding them on two requests is implausible."},{"text":"The tutorial provisioned always-on resources (typically a managed database and a NAT gateway) which bill per hour for existing, so the cost is unrelated to how often the demo was opened.","correct":true},{"text":"Storage costs accumulated because the container images were never deleted.","correct":false,"tempting":"Names a real charge that is normally cents per month, far too small to explain the figure."}]},"prev":{"slug":"version-control-in-public","title":"Git, and what a reviewer sees before your code","url":"https://addaly.com/learn/ai-careers/version-control-in-public"},"next":{"slug":"the-spreadsheet-nobody-lists","title":"The spreadsheet skill nobody puts on a syllabus","url":"https://addaly.com/learn/ai-careers/the-spreadsheet-nobody-lists"},"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, the container, and a cloud bill of zero', in Working in AI. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/ai-careers/the-command-line-and-the-free-tier (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, the container, and a cloud bill of zero","courseTitle":"Working in AI","module":{"index":3,"slug":"the-evidence","title":"The evidence: what gets tested, and how to prove you have it"},"answer":null,"keyIdea":"Cloud costs are dominated by resources that bill for existing rather than for working, so set a budget alert first and prefer things that scale to zero.","hero":{"kind":"figure","figure":{"t":"figure","label":"Figure","figure":{"type":"bars","unit":"US dollars per month","title":"What a forgotten resource costs in a month","series":[{"label":"GPU instance stopped but not terminated, one long weekend","value":240,"highlight":true},{"label":"Small managed database, nobody connected","value":40},{"label":"NAT gateway a tutorial created silently","value":32},{"label":"Object storage for a 5 GB project","value":0.12},{"label":"Serverless function at portfolio traffic","value":0}],"caption":"The bill is for existing, not for working. Compute you actually used is rarely the surprise; a database nobody connects to and a GPU that was stopped rather than terminated are. Set a budget alert before creating anything, and prefer things that scale to zero."},"alt":"Figure: What a forgotten resource costs in a month. Bars (US dollars per month): GPU instance stopped but not terminated, one long weekend 240; Small managed database, nobody connected 40; NAT gateway a tutorial created silently 32; Object storage for a 5 GB project 0.12; Serverless function at portfolio traffic 0. The bill is for existing, not for working. Compute you actually used is rarely the surprise; a database nobody connects to and a GPU that was stopped rather than terminated are. Set a budget alert before creating anything, and prefer things that scale to zero."}},"blocks":[{"t":"h2","id":"where-notebooks-stop","runs":[{"text":"Where notebooks stop"}]},{"t":"p","runs":[{"text":"Almost every course teaches you inside a notebook. Almost every job eventually puts you on a machine that has no notebook, no graphical interface and no mouse: a server, a container, a continuous-integration runner. The gap between those two worlds ends more early careers than any missing algorithm."}]},{"t":"p","runs":[{"text":"The good news is that the gap is small and closes in a fortnight."}]},{"t":"h2","id":"twenty-commands-cover-most-of-it","runs":[{"text":"Twenty commands cover most of it"}]},{"t":"p","runs":[{"text":"cd","code":true},{"text":" "},{"text":"ls","code":true},{"text":" "},{"text":"pwd","code":true},{"text":" "},{"text":"cat","code":true},{"text":" "},{"text":"less","code":true},{"text":" "},{"text":"head","code":true},{"text":" "},{"text":"tail","code":true},{"text":" "},{"text":"grep","code":true},{"text":" "},{"text":"find","code":true},{"text":" "},{"text":"wc","code":true},{"text":" "},{"text":"sort","code":true},{"text":" "},{"text":"uniq","code":true},{"text":" "},{"text":"cut","code":true},{"text":" "},{"text":"sed","code":true},{"text":" "},{"text":"awk","code":true},{"text":" "},{"text":"chmod","code":true},{"text":" "},{"text":"ssh","code":true},{"text":" "},{"text":"scp","code":true},{"text":" "},{"text":"curl","code":true},{"text":" "},{"text":"tar","code":true},{"text":", plus "},{"text":"df","code":true},{"text":" and "},{"text":"du","code":true},{"text":" when a disk fills and "},{"text":"ps","code":true},{"text":"/"},{"text":"kill","code":true},{"text":" when something will not stop."}]},{"t":"p","runs":[{"text":"The reason these are worth learning is that they compose. A single line answers a question that would otherwise be a twenty-minute script:"}]},{"t":"code","lang":"bash","label":"Bash","text":"grep ERROR app.log | awk '{print $5}' | sort | uniq -c | sort -rn | head"},{"t":"p","runs":[{"text":"Read it right to left: find the error lines, take the fifth field, sort them together, count each distinct value, sort those counts descending, show the top ten. That is the most common diagnostic in operational work and it runs on a log file of any size that fits on disk."}]},{"t":"p","runs":[{"text":"Two habits make the shell survivable. Keep a plain text file of commands you had to look up: after two months you will stop consulting it, and the writing is what made that happen. And run "},{"text":"history | grep <word>","code":true},{"text":" to find what you did last Tuesday, because you did not remember it either."}]},{"t":"h2","id":"environments-and-why-it-works-on-my-machine","runs":[{"text":"Environments, and why “it works on my machine”"}]},{"t":"p","runs":[{"text":"Python’s default behaviour installs packages globally, so two projects fight over one version of a library and eventually somebody’s code stops running. The fix takes ten seconds:"}]},{"t":"code","lang":"bash","label":"Bash","text":"python -m venv .venv\nsource .venv/bin/activate      # Windows: .venv\\Scripts\\activate\npip install -r requirements.txt\npip freeze > requirements.txt"},{"t":"p","runs":[{"text":"uv","code":true},{"text":" is a newer, much faster, free tool that does the same thing and is worth adopting. Whichever you use, the rule is that a project states its dependencies in a file that is committed, and a stranger can reproduce your environment from that file alone. If they cannot, your portfolio project does not run for the reviewer, and a project that does not run is not evidence."}]},{"t":"h2","id":"containers-in-one-page","runs":[{"text":"Containers, in one page"}]},{"t":"p","runs":[{"text":"A container packages your code with its operating-system dependencies so it behaves identically wherever it runs. A complete, useful Dockerfile:"}]},{"t":"code","lang":"dockerfile","label":"Dockerfile","text":"FROM python:3.12-slim\nWORKDIR /app\nCOPY requirements.txt .\nRUN pip install --no-cache-dir -r requirements.txt\nCOPY . .\nCMD [\"python\", \"main.py\"]"},{"t":"p","runs":[{"text":"Two commands run it: "},{"text":"docker build -t myapp .","code":true},{"text":" then "},{"text":"docker run myapp","code":true},{"text":". That is most of what a junior needs. Docker Desktop is free for personal use and small companies; Podman and Colima are free alternatives with no licence conditions at all."}]},{"t":"h2","id":"ssh-briefly","runs":[{"text":"SSH, briefly"}]},{"t":"p","runs":[{"text":"Generate a key once with "},{"text":"ssh-keygen -t ed25519","code":true},{"text":", put the public half on the server and on GitHub, and never type a password again. The private key never leaves your machine and never goes in a repository: a leaked key is an incident, and scanners find them within minutes of a public commit."}]},{"t":"h2","id":"the-free-tier-and-the-bill-that-surprises-people","runs":[{"text":"The free tier, and the bill that surprises people"}]},{"t":"p","runs":[{"text":"You can do all of this at no cost. Cloud providers have free tiers; Oracle Cloud and Google Cloud both offer small always-free virtual machines, GitHub Actions gives free minutes on public repositories, and Colab and Kaggle give free GPU hours that are enough to train real models at small scale. A second-hand laptop running Linux, or WSL on Windows, is a complete environment."}]},{"t":"p","runs":[{"text":"The bills that catch people are not compute-hours spent doing work. They are resources that bill for "},{"text":"existing","b":true},{"text":":"}]},{"t":"ul","items":[[{"text":"A managed database left running: a small one is roughly $15 to $60 a month, forever, whether or not anything connects to it."}],[{"text":"A NAT gateway, which many tutorials create silently: about $30 a month plus data charges."}],[{"text":"Egress","b":true},{"text":" (data leaving the cloud) charged per gigabyte, which is how a “small” export becomes a real number."}],[{"text":"A GPU instance you stopped using but did not terminate. At a few dollars an hour, a forgotten weekend is a few hundred dollars."}]]},{"t":"p","runs":[{"text":"Two defences, both free and both taking five minutes. Set a billing alert and a budget on the day you create the account, before you create anything else. And prefer things that scale to zero (serverless functions, object storage, a container that runs on a schedule) over anything that runs continuously."}]},{"t":"h2","id":"the-limitation","runs":[{"text":"The limitation"}],"role":"limit"},{"t":"p","runs":[{"text":"None of this is intellectually difficult and all of it is unfamiliar, which is a worse problem, because unfamiliarity feels like inability. Expect two weeks of looking things up constantly. That is the normal cost, not a signal about you."}]}],"check":{"question":[{"text":"A learner follows a tutorial, deploys a small demo, uses it twice, and receives a $94 bill the next month despite almost no traffic. What is the most likely explanation?"}],"options":[{"text":[{"text":"The demo was attacked or scraped, generating request volume they did not see."}],"correct":false,"tempting":[{"text":"Assumes usage drove the bill, when the pattern of a near-idle service costing tens of dollars points at resources charged by the hour regardless of use."}]},{"text":[{"text":"Free tier limits were exceeded because free tiers only cover the first month."}],"correct":false,"tempting":[{"text":"Misstates how free tiers work; most are ongoing monthly allowances, and exceeding them on two requests is implausible."}]},{"text":[{"text":"The tutorial provisioned always-on resources (typically a managed database and a NAT gateway) which bill per hour for existing, so the cost is unrelated to how often the demo was opened."}],"correct":true,"tempting":null},{"text":[{"text":"Storage costs accumulated because the container images were never deleted."}],"correct":false,"tempting":[{"text":"Names a real charge that is normally cents per month, far too small to explain the figure."}]}],"order":[3,2,1,0],"why":null},"prev":{"slug":"version-control-in-public","title":"Git, and what a reviewer sees before your code","minutes":8},"next":{"slug":"the-spreadsheet-nobody-lists","title":"The spreadsheet skill nobody puts on a syllabus","minutes":7}}}