|
| 1 | +--- |
| 2 | +title: What is a command shell? |
| 3 | +ms.date: 02/13/2025 |
| 4 | +description: This article explains the difference between command shells, command-line tools, and terminals. |
| 5 | +--- |
| 6 | +# What is a command shell? |
| 7 | + |
| 8 | +Many people use the terms _command shell_, _command-line tool_, and _terminal_ interchangeably, |
| 9 | +which can be confusing. This article explains the difference between these concepts and provides |
| 10 | +examples of each. |
| 11 | + |
| 12 | +A **command shell** is an interactive command-line interface for managing a computer, also known as a |
| 13 | +**Read-Eval-Print Loop** ([REPL][14]). |
| 14 | + |
| 15 | +A shell takes input from the keyboard, evaluates that input, and executes the input as a shell |
| 16 | +command or forwards the input to the operating system to be executed. Most shells can also read |
| 17 | +commands from a script file, and can include programming features like variables, flow control, and |
| 18 | +functions. |
| 19 | + |
| 20 | +## Types of command shells |
| 21 | + |
| 22 | +There are two main types of command shells: |
| 23 | + |
| 24 | +- General purpose command shells |
| 25 | + |
| 26 | + General purpose command shells provide are designed to work with the operating system and allow |
| 27 | + you to run any command that the operating system supports. They also include shell-specific |
| 28 | + commands and programming features. The following list contains some examples of general purpose |
| 29 | + command shells: |
| 30 | + |
| 31 | + - [PowerShell][16] |
| 32 | + - [Windows Command Shell][06] |
| 33 | + - [bash][15] - popular on Linux |
| 34 | + - [zsh][12] - popular on macOS |
| 35 | + |
| 36 | +- Utility command shells |
| 37 | + |
| 38 | + Utility command shells are designed to work with specific applications or services. These shells |
| 39 | + can only run commands that are specific to the application or service. Some utility shells support |
| 40 | + running commands from a batch script, but don't include programming features. Usually, these |
| 41 | + shells can only be used interactively. |
| 42 | + |
| 43 | + - [AI Shell][04] - An interactive-only shell used to communicate with AI services such as Azure |
| 44 | + OpenAI. |
| 45 | + - [netsh][07] - Network shell (netsh) is a command-line utility that allows you to configure and |
| 46 | + display the status of various network components on Windows. It's both a command-line tool and a |
| 47 | + command shell. It also supports running commands from a script file. |
| 48 | + |
| 49 | +## Command-line tools |
| 50 | + |
| 51 | +A **command-line tool** is a standalone program that you run from a command shell. Command-line |
| 52 | +tools are typically designed to perform a specific task, such as managing files, configuring |
| 53 | +settings, or querying for information. Command-line tools can be used in any shell that supports |
| 54 | +running external programs. |
| 55 | + |
| 56 | +- [Azure CLI][02] - a collection of command-line tools for managing Azure resources that can be run |
| 57 | + in any supported shell. |
| 58 | +- [Azure PowerShell][03] - a collection of PowerShell modules for managing Azure resources that can |
| 59 | + be run in any supported version of PowerShell. |
| 60 | +- [OpenSSH for Windows][05] - includes a command-line client and a server that provides secure |
| 61 | + communication over a network. |
| 62 | +- [Windows Commands][08] - a collection of command-line tools that are built into Windows. |
| 63 | + |
| 64 | +In general, command-line tools don't provide a command shell (REPL) interface. The `netsh` command |
| 65 | +in Windows is an exception, as it's both a command-line tool and an interactive command shell. |
| 66 | + |
| 67 | +## Terminals |
| 68 | + |
| 69 | +A **terminal** is an application that provides a text-based window for hosting command shells. Some |
| 70 | +terminals are designed to work with a specific shell, while others can host multiple shells. They |
| 71 | +can also include advanced features such as: |
| 72 | + |
| 73 | +- Ability to create multiple panes within a single window |
| 74 | +- Ability to create multiple tabs to host multiple shells |
| 75 | +- Ability to change color schemes and fonts |
| 76 | +- Support for copy and paste operations |
| 77 | + |
| 78 | +The following list contains some examples of terminal applications: |
| 79 | + |
| 80 | +- [Windows Terminal][10] - a modern terminal application for Windows that can host multiple shells. |
| 81 | +- [Windows Console Host][09] - the default host application on Windows for text-based applications. |
| 82 | + It can also host the Windows Command Shell or PowerShell. |
| 83 | +- [Terminal for macOS][13] - the default terminal application on macOS that can host the bash or zsh |
| 84 | + shell. |
| 85 | +- [iTerm2 for macOS][11] - a popular 3rd-party terminal application for macOS. |
| 86 | +- [Azure Cloud Shell][01] - a browser-based terminal application hosted in Microsoft Azure. Azure |
| 87 | + Cloud shell gives you the choice of using bash or PowerShell. Each shell comes preconfigured with |
| 88 | + many command-line tools for managing Azure resources. |
| 89 | + |
| 90 | +<!-- link references --> |
| 91 | +[01]: /azure/cloud-shell/overview |
| 92 | +[02]: /cli/azure |
| 93 | +[03]: /powershell/azure |
| 94 | +[04]: /powershell/utility-modules/aishell/overview |
| 95 | +[05]: /windows-server/administration/openssh/openssh-overview |
| 96 | +[06]: /windows-server/administration/windows-commands/cmd |
| 97 | +[07]: /windows-server/administration/windows-commands/netsh |
| 98 | +[08]: /windows-server/administration/windows-commands/windows-commands |
| 99 | +[09]: /windows/console/consoles |
| 100 | +[10]: /windows/terminal |
| 101 | +[11]: https://iterm2.com/ |
| 102 | +[12]: https://support.apple.com/102360 |
| 103 | +[13]: https://support.apple.com/guide/terminal/welcome/mac |
| 104 | +[14]: https://wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop |
| 105 | +[15]: https://www.gnu.org/software/bash/ |
| 106 | +[16]: overview.md |
0 commit comments