Terminal, Shell, and Command: Three Different Things

Learn the vocabulary that separates the terminal window, the shell interpreting input, and the commands doing the work.

By Ian Fang Beginner 16 minutes
A student-centered editorial illustration representing Terminal, Shell, and Command: Three Different Things.

A terminal, a shell, and a command are different parts of one interaction. The terminal provides the text interface. The shell reads and interprets what you enter. A command performs a specific operation. This model helps you diagnose problems across Windows, macOS, and Linux.

The three-part model

Imagine entering this in a terminal:

python --version

Three components participate:

  1. Terminal application: displays the prompt, accepts keyboard input, and shows text output.
  2. Shell: reads the command line, identifies what should run, and connects input and output.
  3. Command: python performs the requested operation; --version asks it to report version information.

Closing a terminal window, changing the shell, and installing a command are therefore different actions.

A terminal is the interface

A terminal application creates the window, tab, or pane in which text interaction occurs. Examples include Windows Terminal, the macOS Terminal application, and terminal emulators on Linux desktops.

The terminal can control appearance, fonts, tabs, keyboard shortcuts, copying, and scrolling. It does not by itself define every command you can run.

When text is too small or a shortcut behaves unexpectedly, inspect terminal settings. When command syntax fails, investigate the shell or command instead.

A shell interprets command lines

A shell is a command-language interpreter. It reads input, expands shell syntax, locates commands, starts them, and reports their results. POSIX defines sh as a command-language interpreter that executes commands from a command-line string, standard input, or a file. See the POSIX sh specification.

Common shells include PowerShell, Bash, Zsh, and Fish. Their syntax overlaps, but it is not identical. Quoting, variables, pipelines, scripts, and environment handling can differ.

This distinction explains a frequent support question:

“Why does this command work in one terminal but not another?”

The terminal may be different, but the more important difference is often the shell running inside it.

A command performs an operation

A command may be:

  • a program installed on the computer;
  • a command built into the shell;
  • a shell function or alias;
  • a script; or
  • a subcommand selected within a larger program.

For example, git status invokes the git program and selects its status subcommand. In PowerShell, Get-Location is a cmdlet provided through the PowerShell environment. The exact implementation matters when you ask for help, but both are commands from the user’s perspective.

Name the parts of a command line

Consider:

git log --oneline README.md
Part Example Meaning
Command git Program or operation invoked
Subcommand log Operation selected within git
Option --oneline Modifies command behavior
Argument README.md Value or target supplied to the command

Terminology varies among tools. PowerShell commonly calls its named inputs parameters. Some documentation uses option, flag, and switch with specific meanings. Use the term chosen by the command’s official help when precision matters.

The prompt is not part of the command

A prompt shows that the shell is ready for input. It may display a directory, username, computer name, environment, or privilege marker:

student@laptop project %

If documentation shows:

$ git status

the $ usually represents a prompt. Type git status, not the dollar sign. PowerShell examples may show PS> for the same reason.

Prompt symbols are conventions, not universal guarantees. Read the surrounding explanation before copying an example.

Input, output, and errors move through the interaction

A command can receive input from:

  • arguments on the command line;
  • typed standard input;
  • a file;
  • another command; or
  • an environment variable or configuration source.

It can produce standard output for ordinary results and standard error for diagnostic messages. The terminal displays both by default, which can make them look like one stream even though shells can route them separately.

Knowing the source of a value improves debugging. “The terminal rejected my file” is less precise than “the shell passed this path as an argument, and the command reported that the file was not found.”

Exit status is separate from visible output

A command returns an exit status when it finishes. By convention, zero indicates success and a nonzero value indicates another result or failure. The exact nonzero meanings belong to the command’s documentation. POSIX specifies how shells use and report command exit statuses; see Shell Command Language.

Visible text alone is not a reliable success test. A command can produce output and still return failure. A successful command may produce no output.

Diagnose the correct layer

Symptom First layer to inspect
Font, colors, tab, or copy behavior Terminal
Quoting, variables, aliases, or pipeline syntax Shell
Unknown option or invalid argument Command help
“Command not found” Shell search path and installation
Program ran but produced the wrong result Command inputs, state, and docs
Window closed unexpectedly Terminal settings, shell exit, or command effect

The table does not replace investigation. It gives you a precise starting point.

Common mistakes

  • Calling every terminal application “the command prompt.”
  • Assuming commands and quoting rules transfer unchanged between shells.
  • Typing the displayed prompt symbol.
  • Calling an argument an option without checking the tool’s syntax.
  • Treating printed output as proof of success.
  • Installing another terminal application when the missing component is a command.

Do this now

Open your usual terminal and identify:

  1. the terminal application’s name;
  2. the shell’s name;
  3. the visible prompt;
  4. one command;
  5. one option or parameter;
  6. one argument; and
  7. the command’s output and exit status.

If you do not yet know how to display the shell name or exit status, record that as a question for the operating-system module. Do not paste an unfamiliar command merely to complete the list.

Log what you learned

Record only:

  • Result: What did the action produce?
  • Evidence: What observation, test, or source supports that result?
  • Next action or unresolved question: What should happen next?