"I started using an AI agent and suddenly this black screen called a terminal appeared." "Everyone says 'just run a command' — but type what, exactly?" This is the first stumbling block for non-engineers entering the world of AI tools.
This guide explains the terminal (CLI) from zero: the five commands you actually need, the dangerous commands you absolutely must know about, and why learning the CLI matters in the age of AI agents. The content is based on the foundation lectures we use in our corporate training and online courses.
For the bigger picture of AI agents, start with The Complete Guide to AI Agents for Business.
What you will learn
- What a terminal is — a "text command window" into your computer
- GUI vs. CLI — strengths of each and when to use which
- How to open a terminal (Mac / Windows / editor-integrated terminal)
- The five essential commands: pwd, ls, cd, mv, cp
- Four dangerous commands and the safety rules that go with them
- Why the CLI is worth learning in the age of AI agents
What is a terminal? A text command window into your computer
A terminal is a tool for operating your computer by typing text. Normally you click icons with a mouse to open folders or move files; in a terminal, you do the same operations with text (commands).
Commands typed into the terminal go straight to the operating system (macOS or Windows). Creating, moving, and deleting files, running programs — almost everything inside your computer can be controlled from here.
Crucially, AI agents such as Claude Code and Codex run inside the terminal. Knowing the basics lets you understand what your agent is doing behind the scenes — and give it sharper instructions.

GUI vs. CLI
| Aspect | GUI (graphical user interface) | CLI (command-line interface) |
|---|---|---|
| Operation | Mouse and touch, visually oriented | Typed text, efficiency oriented |
| Speed | One click at a time | One command line executes instantly |
| Learning curve | Low (you can see it) | Somewhat higher (memorize commands) |
| Automation | Hard | Easy with scripts |
| AI compatibility | Limited tool support | Excellent — it is all text |
The GUI's strength is intuitiveness; the CLI's strengths are speed on repetitive work and easy automation and scripting. To reach a folder four levels deep, the GUI takes four double-clicks; the CLI arrives with a single line.
The decisive factor is AI compatibility. AI agents work by reading and writing text — they cannot click GUI buttons. Knowing CLI basics is what lets you direct an agent precisely.
How to open a terminal
On a Mac
- Spotlight search: Cmd + Space → type "Terminal" → Enter
- Finder: Applications → Utilities → Terminal.app
- Cursor / VS Code integrated terminal: Ctrl + ` (backtick)
On Windows (WSL2)
- Open Windows Terminal and select the Ubuntu (WSL) tab
- When the bash prompt appears you are ready — the same commands as Mac/Linux work
- Cursor / VS Code integrated terminal: Ctrl + ` (backtick)
In practice, the Cursor / VS Code integrated terminal (Ctrl + `) is the most convenient: it appears right at the bottom of your editor, in the same window as your AI agent.
The five essential commands
| Command | Role | Description |
|---|---|---|
| pwd | Show current location | Prints the path of the folder (directory) you are in |
| ls | List files | Lists the contents of the current folder |
| cd | Change folder | Moves into the specified folder; cd .. goes one level up |
| mv | Move / rename | Moves a file or folder, or renames it |
| cp | Copy | Duplicates a file; the -r option copies a whole folder |
In action:
pwd # check where you are
/Users/you/projects
ls # list files
Desktop Documents Downloads projects
cd projects # move into a folder
cd .. # go one level up
cd ~/Desktop # jump straight to Desktop
mv report.txt archive/ # move into the archive folder
mv old-name.txt new-name.txt # rename
cp memo.txt memo-backup.txt # copy a file
cp -r my-app my-app-backup # copy a whole folder
Two habits that will save you grief:
- Tab completes names — press Tab partway through a file or folder name and it autocompletes. No more typing long names; use it constantly
- When in doubt, pwd — working in the wrong folder causes "file not found" errors. Make checking your location with
pwda reflex
Dangerous commands: irreversible if you don't know them
The following commands can destroy data permanently. Always read what you are about to run.
| Command | Danger |
|---|---|
| rm -rf | Deletes a folder and all its contents without confirmation. rm -rf / destroys the entire system |
| sudo + a dangerous command | Runs with administrator rights, so a wrong command can damage system files |
| chmod 777 | Grants read/write/execute to all users — a serious security risk |
| > filename | Overwrites the file with empty content; precious file contents vanish in an instant |
Four safety rules
- Use
rm -i(interactive mode) instead ofrm, confirming one item at a time - Run
lsto inspect the target before deleting - Understand any command copied from the internet before running it
- Keep important files under Git version control or backed up
The same applies when an AI agent proposes a terminal command: read it before executing. Most agents ask for confirmation before dangerous operations, but the final judgment is a human job. For configuring guardrails — telling the agent what it must never do — see Prompt Injection and LLM Security.
When an error appears: how to hand it to your AI agent
If the terminal throws an error and you want to ask an AI agent for help, copy the entire error message. A truncated error makes the cause impossible to pin down. Every line displayed is a clue, not just the first one.
State what you were trying to do, plus what is happening now (the full error text or a screenshot) — that pairing is the fastest way to learn the terminal with an AI agent as your tutor. To get a whole team trained hands-on, see our corporate AI agent training.
Frequently asked questions
Q. Are "terminal" and "CLI" the same thing?
A. Strictly speaking, CLI (command-line interface) is the method of operating by typing text, while the terminal is the screen (tool) you use to do it. In everyday conversation they are used interchangeably. The contrasting concept is the GUI (graphical user interface), operated with mouse and touch. Opening a folder is a double-click in the GUI and a cd folder-name command in the CLI.
Q. Do non-engineers really need to learn the terminal? A. If you use AI agents, the basics are worth knowing. Agents like Claude Code and Codex run inside the terminal and work by reading and writing text — they cannot click GUI buttons. Just knowing the five essential commands (pwd, ls, cd, mv, cp) and the dangerous ones lets you understand what your agent is doing and sanity-check the commands it proposes.
Q. Which commands should I memorize first? A. Five: pwd (show current location), ls (list files), cd (change folder), mv (move/rename), and cp (copy). Together they cover basic file management end to end. Add two habits — Tab autocompletes file names, and pwd confirms where you are whenever in doubt — and most beginner stumbles disappear.
Q. Why is rm -rf so dangerous?
A. Because it deletes a folder and everything inside it instantly, without confirmation, and irreversibly. Unlike the GUI trash can, there is no undo. rm -rf / destroys the entire system. Protect yourself by using rm -i (interactive mode) to confirm one item at a time, inspecting targets with ls before deleting, keeping important files in Git or backups, and always reading any rm command an AI agent proposes before executing it.
Q. Can I use the same commands on Windows as on a Mac? A. Yes, via WSL2 (Windows Subsystem for Linux). Open the Ubuntu (WSL) tab in Windows Terminal, and once the bash prompt appears, the same commands as Mac/Linux (pwd, ls, cd, and so on) work as-is. The Cursor / VS Code integrated terminal (Ctrl + `) also feels identical on every OS, so when working with AI agents, the integrated terminal is the easiest place to start.
Related articles
- The Complete Guide to AI Agents for Business
- Prompt Injection and LLM Security
- Tokens and Context Windows Explained
- Skills, SubAgents & Agent Teams
- Corporate AI Agent Training (hands-on)
Ready to put AI agents to work?
Turn what you just read into real workflows. AI Agent Camp helps non-technical professionals go from using to building — hands-on.
Last reviewed: 2026-06-10