On this page9 sections
- 01How do I open the terminal on a Mac, Windows or Linux?
- 02The 15 commands at a glance
- 03What do pwd, ls and cd mean?
- 04Reading and changing files: cat, open, cp, mv and rm
- 05What does npm install mean?
- 06Check what the agent changed with git status
- 07How do I install and start a coding agent from the terminal?
- 08What should you never paste into a terminal?
- 09FAQ
The terminal for beginners comes down to one window and about 15 commands. Open it with Spotlight on a Mac, Windows key + X on Windows 11, or Ctrl+Alt+T on Ubuntu. Then use pwd, ls and cd to find your project, cat, cp, mv and rm to handle files, and npm install, npm run and git status to run and check what an AI coding agent builds.
Coding agents such as Claude Code, Codex and Gemini CLI live in the terminal. They type most commands themselves, but they ask you to approve them, so you need to know what you are saying yes to. We ran every command below on a Mac, in a small test project, and pasted the real output. The Windows versions come from Microsoft’s documentation.
- Open a terminal: Spotlight and “Terminal” on a Mac, Windows key + X then Terminal on Windows 11, Ctrl+Alt+T on Ubuntu.
- Move around with
pwd,ls,cdandmkdir. - Handle files with
cat,open,cp,mvandrm. Files deleted withrmskip the Trash. - Run projects with
which,node -v,npm install,npm runandnpx, and check changes withgit status. - Never paste a command from a pop-up, an ad or a stranger, and keep API keys out of terminals and chats.
How do I open the terminal on a Mac, Windows or Linux?
Every system ships with a terminal app, and you open it like any other app. Here is each vendor’s way, with the shell you land in (the program that reads your commands).
| System | How to open it | The shell you get | Source |
|---|---|---|---|
| Mac | Press Command and Space for Spotlight, type Terminal, press Return. Or open Finder, Applications, Utilities, Terminal. | zsh, the default since macOS 10.15 | Apple |
| Windows 11 | Press the Windows key and X, then choose Terminal (not the Admin one). Windows Terminal has been the default since Windows 11 version 22H2. | PowerShell | Microsoft, FAQ |
| Windows 10 | Install Windows Terminal from the Microsoft Store, then open it from Start. | PowerShell | Microsoft |
| Ubuntu and most Linux | Press Ctrl+Alt+T, or search your apps for Terminal. | Usually bash | Ubuntu |
A line in the window ending in %, $ or > is the prompt: the shell is waiting for you. Type a command, press Return, and read what comes back. In this guide, a line starting with $ is something you type (without the $), and the lines under it are what the computer printed.
Three keys and one command save most of the typing. Up arrow brings back your last command. Tab completes a file or folder name. Ctrl+C stops whatever is running; in a terminal it does not copy, so on Windows Terminal copy is Ctrl+Shift+C by default. And clear wipes the screen.
The 15 commands at a glance
These are the commands an agent uses most, and the ones it will ask you to approve. Most work in Windows PowerShell under the same name, because Microsoft built in aliases for them.
| # | Command | What it does | On Windows PowerShell |
|---|---|---|---|
| 1 | pwd | Shows which folder you are in | Same |
| 2 | ls | Lists what is in the folder | Same (ls -Force shows hidden files) |
| 3 | cd | Moves into another folder | Same |
| 4 | mkdir | Makes a new folder | Same |
| 5 | cat | Prints a file’s contents | Same |
| 6 | open . | Opens the folder in Finder | explorer . |
| 7 | cp | Copies a file | Same |
| 8 | mv | Moves or renames a file | Same |
| 9 | rm | Deletes a file for good | Same |
| 10 | which | Shows where a program is installed | Get-Command |
| 11 | node -v | Shows the Node.js version | Same |
| 12 | npm install | Installs a project’s packages | Same |
| 13 | npm run | Runs one of the project’s scripts | Same |
| 14 | npx | Runs a tool from a package | Same |
| 15 | git status | Shows what changed since the last save point | Same |
What do pwd, ls and cd mean?
pwd prints the folder you are in, ls lists what is inside it, and cd moves you into another folder. Together they answer the question every beginner asks first: where am I, and where is my project?
$ pwd
/private/tmp/.../terminal-for-ai-agents/my-app
$ ls
README.md package.json server.js
$ ls -a
. .env .gitignore package.json
.. .git README.md server.jsWe shortened our test folder’s long path with .... Yours will look more like /Users/yourname/my-app. The -a in ls -a shows hidden files, whose names start with a dot. That is how you spot a .env file, where projects keep secrets such as API keys.
cd notes moves into a folder called notes, cd .. goes up one level, and cd ~ takes you to your home folder. mkdir notes makes that folder in the first place. When they work, cd and mkdir print nothing at all, and silence means success.
Reading and changing files: cat, open, cp, mv and rm
cat prints a file to the screen, which is the quickest way to read a small file an agent just wrote:
$ cat package.json
{
"name": "my-app",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "node server.js"
}
}open . opens the current folder in Finder, where the dot means “this folder”. On Windows it is explorer ., and on Linux xdg-open .. It printed nothing; a Finder window appeared.
cp copies, mv moves or renames, and rm deletes:
$ cp README.md README-copy.md
$ ls
README-copy.md README.md notes package.json server.js
$ mv README-copy.md notes/
$ ls notes
README-copy.md
$ rm notes/README-copy.md
$ ls notesThe last ls printed nothing because the folder is empty again.
What does npm install mean?
npm install downloads the packages a project lists in its package.json file into a node_modules folder. npm comes with Node.js, which most JavaScript projects and several coding agents need. First, check both are installed:
$ which node npm git
/opt/homebrew/bin/node
/opt/homebrew/bin/npm
/usr/bin/git
$ node -v
v26.0.0which shows where each program lives. If it prints nothing, or your shell says command not found, the program is not installed or your shell cannot find it. The fix for Node.js is the LTS installer from nodejs.org.
Here we add a code formatter called Prettier, the way an agent would, then run a plain npm install, which installs everything the project lists:
$ npm install --save-dev prettier
added 1 package, and audited 2 packages in 1s
1 package is looking for funding
run `npm fund` for details
found 0 vulnerabilities
$ npm install
up to date, audited 2 packages in 597msnpm run starts one of the scripts listed in package.json. This one starts a small web server, which keeps running until you press Ctrl+C:
$ npm run dev
> my-app@1.0.0 dev
> node server.js
my-app is running at http://localhost:3000npx runs a tool from a package. It uses the project’s own copy first, and asks before downloading a package it cannot find:
$ npx prettier --check server.js
Checking formatting...
All matched files use Prettier code style!Read that download prompt carefully. Attackers register package names that sound right, and AI tools sometimes invent names that attackers then claim, a trick called slopsquatting.
Check what the agent changed with git status
git status lists every file that changed since your last commit, git’s word for a save point. Run it whenever an agent finishes, before you accept its work:
$ git status
On branch main
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: package.json
Untracked files:
(use "git add <file>..." to include in what will be committed)
package-lock.json
no changes added to commit (use "git add" and/or "git commit -a")“Modified” means an existing file changed, and “untracked” means a new file git has not seen before. Our git guide for AI coding covers the commands that undo them.
How do I install and start a coding agent from the terminal?
Most coding agents install with one command and start when you type their name inside your project folder. These are the official install commands, checked on September 28, 2026 on each vendor’s install page. The last is for Cyborb, a desktop AI agent from Orbioom and our product:
# Claude Code (macOS, Linux, WSL), from Anthropic's setup docs
curl -fsSL https://claude.ai/install.sh | bash
# Codex CLI (macOS, Linux), from OpenAI's docs
curl -fsSL https://chatgpt.com/codex/install.sh | sh
# Gemini CLI (needs Node.js 20 or later), from Google's GitHub
npm install -g @google/gemini-cli
# Cyborb CLI (ours; macOS on Apple Silicon, Linux x64), from cyborb.ai
curl -fsSL https://cyborb.ai/install | bashOn Windows, Anthropic’s command for PowerShell is irm https://claude.ai/install.ps1 | iex, the Gemini CLI line works as it is, and OpenAI’s Codex page on GitHub lists a PowerShell command. Before you paste any install command, it is worth a minute to check the script first.
Then move into your project and start the agent by name: claude, codex, gemini or cyborb. Each one asks you to sign in the first time.
Claude Code needs a paid Claude plan or a Console account. Codex takes a ChatGPT plan or an API key. Gemini CLI works with a free Google account, limited to 60 requests a minute and 1,000 a day as of September 2026. Checking the version is a good first test:
$ claude --version
2.1.276 (Claude Code)
$ codex --version
codex-cli 0.155.0
$ gemini --version
0.41.2Your numbers will be newer. If your shell says command not found straight after an install, close the window and open a new one, so the shell rereads its list of places to look for programs.
If you would rather skip the terminal altogether, several agents come as desktop apps too. Cyborb’s desktop app, for example, has the same agent as its CLI built in, so the command line is optional there.
What should you never paste into a terminal?
Never paste a command that a pop-up, a CAPTCHA, an ad, an email or a stranger gave you. Microsoft has tracked this trick, called ClickFix, since early 2024, and in a 2026 Mac campaign the pasted command installed a program that steals passwords, browser data and crypto wallets.
“Fix” and “verify you are human” commands. No real website needs you to paste a command. On macOS 26.4 and later, Terminal may block such a paste and warn you about possible malware.
sudocommands you do not understand. sudo runs a command with full control of the computer. Ubuntu’s advice is to understand what it does before you run it.Install commands from anywhere but the vendor’s own docs. Check the domain letter by letter.
Secrets. Do not type API keys or passwords into commands, where they can end up in your shell’s history file, and never paste them into an agent’s chat. Our guide to keeping API keys safe shows where they belong.
FAQ
Do I need to learn the terminal to use an AI coding agent?
A little. You need to open it, move into your project with cd, start the agent and understand what you approve. The agent handles the rest, and several agents also come as desktop apps if you prefer windows and buttons.
What does “command not found” mean?
The shell could not find a program by that name. Check the spelling first, then run which with the program’s name. If it is missing, install it, then open a new terminal window.
How do I stop a command that will not end?
Press Ctrl+C. It stops the running command, such as a development server, and gives you the prompt back. Closing the window also stops it.
Is it safe to run commands an AI suggests?
Read each one first. Be most careful with anything that deletes (rm), uses sudo, downloads and runs a script, or sends files somewhere. Approve one command at a time until you trust the agent’s habits.
Is PowerShell different from the Mac terminal?
The commands in this guide mostly carry the same names in PowerShell, but options differ. For example, ls -a becomes ls -Force, and which becomes Get-Command. Microsoft lists the built-in aliases in its PowerShell docs.
- Open a terminal with Spotlight, Windows key + X, or Ctrl+Alt+T.
pwd,lsandcdtell you where you are and get you to your project.rmskips the Trash, so read every delete an agent proposes.npm install,npm runandgit statuscover most of an agent’s day.- Paste commands only from official docs, never from pop-ups or strangers.
Ready for a first project? Try building an app without coding, or read whether you should still learn to code.
- Open or quit Terminal on Mac, Apple Support
- Mac keyboard shortcuts, Apple Support
- Use zsh as the default shell on Mac, Apple Support
- Windows Terminal is now the default in Windows 11, Microsoft, October 2022
- Windows Terminal FAQ, Microsoft Learn
- Windows Terminal installation, Microsoft Learn
- An overview of Windows Terminal, Microsoft Learn
- Using aliases, Microsoft Learn, January 2026
- Get-ChildItem, Microsoft Learn, August 2026
- The Linux command line for beginners, Ubuntu
- xdg-open, freedesktop.org
- npm install and npx, npm Docs
- Set up Claude Code, Anthropic, accessed September 2026
- Codex CLI, OpenAI, and openai/codex, GitHub, accessed September 2026
- Gemini CLI, Google on GitHub, accessed September 2026
- From open lures to cloaked gates: how a macOS ClickFix campaign learned to hide, Microsoft Security Blog, August 2026
- Download Cyborb, Orbioom, accessed September 2026




