Shell
A shell is the interface for a user to interact with an operating system. Learn how command-line shells work, the most common examples, how a shell differs from a terminal, and why shell access needs careful control.
What is a shell?
A shell is a program that sits between the user and the operating system's core (the kernel). It accepts commands, runs programs, and returns their output. Most people mean a command-line shell, where commands are typed as text, but a graphical desktop is also a kind of shell. Common command-line shells include Bash and Zsh on Linux and macOS, and PowerShell and Command Prompt on Windows.
How does a shell work?
- The shell displays a prompt and waits for input.
- The user types a command, such as listing files or restarting a service.
- The shell interprets it, expands variables and wildcards, and starts the requested program or runs a built-in command.
- Output and errors are returned to the screen, or redirected to files or other commands.
Shells also run scripts: files containing sequences of commands, used to automate tasks. Remote shells are reached over protocols such as SSH or, for PowerShell, remoting features.
Shell vs. terminal
A terminal (or terminal emulator) is the window or application that displays text and sends keystrokes. The shell is the program running inside it that interprets commands. You can run different shells in the same terminal.
Why does a shell matter?
Shell access is powerful: with the right privileges, a user can change nearly anything on a system. That makes it a primary goal for attackers, who seek a "shell" on a compromised machine. Limiting who has shell access, using separate privileged accounts, keeping credentials out of scripts, and recording administrative shell activity keep that power under control.
Restricting which commands a privileged account can run, and requiring elevation only when needed, further limits what a stolen shell session can do.
Frequently asked questions
What is a shell?
A shell is the interface for a user to interact with an operating system, usually by typing commands that the shell interprets and runs.
What are examples of shells?
Bash, Zsh, and sh on Linux and macOS; PowerShell and Command Prompt on Windows.
What is a reverse shell?
A reverse shell is a connection in which a compromised machine connects back to an attacker and gives them a shell, often used to bypass inbound firewall rules.
Open remote shells from one place
Launch SSH and other remote sessions in one click, with credentials injected at launch.
Related terms
Secure Shell (SSH)
Secure Shell (SSH) is a protocol employing cryptographic techniques to establish a secure connection between a client and a server.
Read now →System Administrator (Sysadmin)
A system administrator (sysadmin) is an IT professional who manages computer systems.
Read now →TELNET
TELNET is a protocol for interfacing terminal devices and processes, and for facilitating terminal-to-terminal and process-to-process communication.
Read now →