Skip to content

Computer basics · guide

What a terminal is

4 min read · Last checked 5 October 2026

Watch: L007: Secure Your API Keys From AI Agent in 10 minutes · L008: The Hidden Prompt Injection Inside Your AI Agent

If you came here from the lesson “Claude Code Can Reach Your Keys”, this page explains the text window the agent types its commands into. You don’t need to know how to code to follow it.

A terminal is a window where you type instructions to your computer instead of clicking on buttons and icons.

A command is one of those typed instructions: a line of text that tells the computer to do one thing, such as “show me what’s in this folder”. You type it and press Enter (Return on a Mac), and the answer appears as text in the same window.

A shell is the program inside the terminal window that reads your command and runs it. The terminal is the window; the shell is what listens inside it. The lesson calls the shell a text window. Strictly, the window is the terminal and the shell runs inside it. Microsoft describes Windows Terminal as a “host application” for shells like Command Prompt and PowerShell, which is the same idea.

A terminal window, labelledA Windows PowerShell window. The prompt PS C:\Users\you> is followed by the command Get-Content notes.txt, and the answer is the file’s two lines, Buy milk and Call the bank. Labels point to the terminal (the window), the shell (the program that reads your line and runs it), the command, and its answer. Windows PowerShellPS C:\Users\you> Get-Content notes.txtBuy milkCall the bankPS C:\Users\you> _12341THE TERMINALthe window you type in2THE SHELLthe program inside it thatreads and runs your line3A COMMANDshow the text ofnotes.txt4ITS ANSWERthe file's two lines
A terminal window, with the four parts named on this page.

Windows. Windows ships with Windows PowerShell, a shell from Microsoft. To start it, open the Start menu, type Windows PowerShell, select it, then select Open. On Windows 11, PowerShell opens inside Windows Terminal, Microsoft’s terminal app. Windows Terminal starts with PowerShell by default, and it’s also available from the Microsoft Store.

macOS. The terminal app is called Terminal. To open it, click Spotlight in the menu bar, type Terminal, and click it. You can also find it in the Finder, in the Applications folder, inside Utilities. The shell it runs is usually zsh.

Linux. Most Linux systems open a terminal with the keyboard shortcut Ctrl+Alt+T, according to Ubuntu’s beginner tutorial. The shell you’ll most likely meet there is called bash.

Commands are short words, often followed by extra words that say what to act on. Two harmless examples follow, one that looks and one that reads. Type only the version for your system.

The first lists what’s in a folder (also called a directory): a named place on your computer that holds files and other folders.

Windows (PowerShell):

Get-ChildItem

macOS or Linux:

ls

Get-ChildItem gets the items in a folder, and with nothing after it, it uses the folder you’re in right now. On Windows, PowerShell also accepts ls and dir for it. A second name for the same command is called an alias. On macOS and Linux, ls stands for “list” and does the same job.

The second example shows the text inside a file called notes.txt.

Windows (PowerShell):

Get-Content notes.txt

macOS or Linux:

cat notes.txt

Get-Content gets the text of a file, one line at a time; notes.txt is the file to show. On Windows, cat is an alias for Get-Content, so either word works there. On macOS and Linux, cat prints a file’s text on screen. Neither command changes the file. They only show it.

Some commands take an extra setting that starts with a dash. In PowerShell, Get-Content notes.txt -TotalCount 5 shows only the first five lines of the file. On macOS or Linux, head -n 5 notes.txt does the same.

The Claude Code docs describe Claude Code, Anthropic’s AI coding agent, as an assistant that “runs in your terminal”, and say it can run “any command you could run”. It types commands into a shell on your computer, and it can run any command you could run yourself. On Windows, it can use PowerShell as its main shell.

A command can also start other programs. A program started by another program is called a subprocess, and it can open files by itself. In the lesson, a deny rule (a setting that blocks the agent from a file) stopped it from showing a file with cat. Yet a one-line script, a small program it wrote and ran, opened the same file anyway. The permissions docs say this directly: those rules don’t apply to “a Python or Node script that opens files itself”. What closes that gap is a sandbox, covered in the sandbox guide. On Windows, the sandbox works only when Claude Code runs inside WSL2, a Linux system that runs on Windows.

Sources

Facts on this page are explained in our own words. Short quotes are marked and linked.