What Is a Shell?
Author: Domeny.ForSale editorial team Published
In brief: A shell is a program that accepts user commands and lets you run programs and perform operations on a computer system. The term most often refers to a text-based shell, such as Bash, Zsh or PowerShell. A shell is not the same as a terminal: the terminal provides a place to enter commands, while the shell interprets them.
What is a system shell used for?
A shell lets you operate a computer using commands rather than clicking buttons and icons. You can use it to browse directories, copy files, launch applications, check running processes or manage a server. The available actions depend on the operating system, installed programs and your account permissions.
When you enter a command, the shell identifies its name and any additional arguments: information that specifies how the task should be performed. It then executes a built-in function or launches an external program. For example, in the command python script.py, the shell launches the Python interpreter and passes it the name of the file to execute—it does not interpret the Python code itself.
Shells are particularly useful for repetitive tasks. Instead of manually renaming dozens of files, you can prepare a set of commands that performs the operation according to a single rule. A set of commands saved in a file like this is called a shell script.
The term “shell” also has a broader meaning: it can refer to a graphical interface for operating a system. In programming documentation and server administration, however, “shell” usually refers to a text-based shell.
Shell, terminal, console and SSH—how do they differ?
These terms are sometimes used interchangeably, but they describe different elements of working with a computer:
| Term | What it means |
|---|---|
| Shell | A program that interprets commands, such as Bash or PowerShell. |
| Terminal | An application providing text input and output in which a shell can run, such as Windows Terminal. |
| Console | A context-dependent term; it can mean a system terminal or, informally, a command window. |
| SSH | A protocol for securely connecting to another computer, often to work in its shell. |
You can therefore open Windows Terminal, run PowerShell in it, and then connect to a Linux server via SSH. After you log in, Bash running on the server may handle your commands. The window stays the same, but the computer executing the commands and the shell being used change.
This distinction matters in practice when reading instructions. A command described as “paste into the terminal” may require a particular shell, operating system or additional program. Simply opening any text window does not guarantee compatibility.
The most popular shells and their uses
Bash is widely used on Linux systems and in administration scripts. Zsh is the default interactive shell for new user accounts in current versions of macOS; you will also encounter it on Linux. The two share many commands and constructs, but not every script will behave identically in both.
PowerShell is developed primarily for automation and administration. It runs on Windows, and its modern releases are also available for Linux and macOS. Unlike typical text-based pipelines in Bash, PowerShell pipelines can pass structured objects, such as process information with separate fields for the name and identifier.
cmd.exe, the classic Windows command interpreter, still appears in older instructions and batch scripts. It is not another name for PowerShell. The commands and syntax of these two shells differ, even though both can run in Windows Terminal.
You do not need to install a new shell to get started. Use the one available in your environment and check which operating system and shell the instructions you are following were written for.
Your first commands: a simple example
A safe starting point is to check the current directory and list its contents. The current directory is the location relative to which the shell resolves paths that are not specified in full.
In Bash or Zsh, enter the following commands in order:
pwd
ls
mkdir shell-practice
cd shell-practice
pwd
The pwd command displays the current directory, ls lists its contents, and mkdir creates a new directory. The cd command changes to the specified directory. This example does not delete any files; it creates a folder called shell-practice, provided you have the necessary permissions and that folder does not already exist.
In PowerShell, the equivalent sequence using full command names looks like this:
Get-Location
Get-ChildItem
New-Item -ItemType Directory -Name shell-practice
Set-Location shell-practice
Get-Location
If a path contains spaces, enclose it in quotation marks, for example cd "My documents". Without them, the shell may treat parts of the path as separate arguments.
How do you use a shell safely?
A shell is not inherently dangerous, but it lets you perform operations on many files quickly. Commands that delete data, change permissions or run as an administrator require particular care. Deleting a file with a command does not necessarily move it to the recycle bin or trash.
Before running an unfamiliar command, check what it does and verify the current directory. Do not copy constructs that download a script from the internet and immediately execute it without understanding them. When connected to a server via SSH, also make sure you know whether you are working in a test or production environment.
Do your first exercises in a separate directory containing copies of unimportant files. Your next step could be learning how to access help for a single command: in Bash, use help cd, and in PowerShell, use Get-Help Set-Location.
See also: What Is AGI?
