Computer program that exposes an operating system's services to a human user or other programs
A graphical interface similar to one from the late 1980s, which features a graphical window for aman page, a shaped window (oclock) as well as severaliconified windows. In the lower right we can see aterminal emulator running aUnix shell, in which the user can type commands as if they were sitting at aterminal.
Incomputing, ashell is a computer program that exposes anoperating system's services to a human user or other programs. In general, operating system shells use either acommand-line interface (CLI) orgraphical user interface (GUI), depending on a computer's role and particular operation. It is named a shell because it is the outermost layer around the operating system.[1][2]
Operating systems provide various services to their users, includingfile management,process management (running and terminatingapplications),batch processing, and operating system monitoring and configuration.
Most operating system shells are notdirect interfaces to the underlyingkernel, even if a shell communicates with the user viaperipheral devices attached to the computer directly. Shells are actually special applications that use the kernelAPI in just the same way as it is used by other application programs. A shell manages the user–system interaction by prompting users for input, interpreting their input, and then handling output from the underlying operating system (much like a read–eval–print loop, REPL).[3] Since the operating system shell is actually an application, it may easily be replaced with another similar application, for most operating systems.
In addition to shells running on local systems, there are different ways to make remote systems available to local users; such approaches are usually referred to as remote access or remote administration. Initially available onmulti-usermainframes, which provided text-based UIs for each active usersimultaneously by means of atext terminal connected to the mainframe via serial line ormodem, remote access has extended toUnix-like systems and Microsoft Windows. On Unix-like systems,Secure Shell protocol (SSH) is usually used for text-based shells, whileSSH tunneling can be used forX Window System–based graphical user interfaces (GUIs). On Microsoft Windows, Remote Desktop Protocol can be used to provide GUI remote access, sinceWindows Vista,PowerShell Remote, sinceWindows 10 build 1809 SSH[4] can also be used for text-based remote access via WMI, RPC, and WS-Management.[5]
Most operating system shells fall into one of two categories – command-line and graphical. Command-line shells provide a command-line interface (CLI) to the operating system, while graphical shells provide a graphical user interface (GUI). Other possibilities, although not so common, include a voice user interface and various implementations of a text-based user interface (TUI) that are not CLI, such as text-based menu systems. The relative merits of CLI- and GUI-based shells are often debated. Many computer users use both depending on the task to be performed.
Early interactive systems provided a simple command-line interpreter as part of theresident monitor. This interpreter might be called by different names, such asCOMCON on DECTOPS-10 systems.[6] The interpreter would execute one of a number of predefined commands, one of which would be to run a user program. Common commands would log the user on and off the system, allocate, free, and manipulate devices and files, and query various pieces of information about the system or a user process.[7]
The purpose of such a procedure is to create a medium of exchange into which one could activate any procedure,as if it were called from the inside of another program. Hereafter, for simplification, we shall refer to that procedure as the "SHELL".
Louis Pouzin, The SHELL: A Global Tool for Calling and Chaining Procedures in the System[8]
In 1964, for theMultics operating system,Louis Pouzin conceived the idea of "using commands somehow like a programming language," and coined the termshell to describe it.[9] In a 1965 document, the shell is defined as "a common procedure called automatically by the supervisor whenever a user types in some message at his console, at a time when he has no other process in active execution under console control. This procedure acts as an interface between console messages and subroutine [in the supervisor]."[10] This system was first implemented byGlenda Schroeder and an unnamed man fromGeneral Electric.[11]
Multics also introduced theactive function, a key concept in all later shells. This is defined as
a string... which is replaced by a character string return value before the command line containing it is executed. Active functions are often used... to implement command-language macros.[12]
In 1971,Ken Thompson developed theThompson shell in the first version of Unix. While simpler than the Multics shell, it contained some innovative features, which have been carried forward in modern shells, including the use of < and > for input and outputredirection.
Acommand-line interface (CLI) is an operating system shell that usesalphanumeric characters typed on a keyboard to provide instructions and data to the operating system, interactively. For example, ateletypewriter can send codes representing keystrokes to a command interpreter program running on the computer; the command interpreter parses the sequence of keystrokes and responds with an error message if it cannot recognize the sequence of characters, or it may carry out some other program action such as loading an application program, listing files, logging in a user and many others. Operating systems such as UNIX have a large variety ofshell programs with different commands, syntax and capabilities, with thePOSIX shell being a baseline. Some operating systems had only a single style of command interface; commodity operating systems such asMS-DOS came with a standard command interface (COMMAND.COM) but third-party interfaces were also often available, providing additional features or functions such as menuing or remote program execution.
Application programs may also implement a command-line interface. For example, in Unix-like systems, thetelnet program has a number of commands for controlling a link to a remote computer system. Since the commands to the program are made of the same keystrokes as the data being sent to a remote computer, some means of distinguishing the two are required. Anescape sequence can be defined, using either a special local keystroke that is never passed on but always interpreted by the local system. The program becomes modal, switching between interpreting commands from the keyboard or passing keystrokes on as data to be processed.
A feature of many command-line shells is the ability to save sequences of commands for re-use. A data file can contain sequences of commands which the CLI can be made to follow as if typed in by a user. Special features in the CLI may apply when it is carrying out these stored instructions. Suchbatch files (script files) can be used repeatedly to automate routine operations such as initializing a set of programs when a system is restarted. Batch mode use of shells usually involves structures, conditionals, variables, and other elements of programming languages; some have the bare essentials needed for such a purpose, others are very sophisticated programming languages in and of themselves. Conversely, some programming languages can be used interactively from an operating system shell or in a purpose-built program.
A command-line interpreter may offer a history function, so that the user can recall earlier commands issued to the system and repeat them, possibly with some editing. Since all commands to the operating system had to be typed by the user, short command names and compact systems for representing program options were common. Short names were sometimes hard for a user to recall, and early systems lacked the storage resources to provide a detailed on-line user instruction guide.
A graphical user interface (GUI) provides means for manipulating programs graphically, by allowing for operations such as opening, closing, moving and resizingwindows, as well as switchingfocus between windows. Graphical shells may be included withdesktop environments or come separately, even as a set of loosely coupled utilities.
Most graphical user interfaces develop themetaphor of an "electronic desktop", where data files are represented as if they were paper documents on a desk, and application programs similarly have graphical representations instead of being invoked by command names.
Graphical shells typically build on top of awindowing system. In the case ofX Window System orWayland, the shell consists of anX window manager or aWayland compositor, respectively, as well as of one or multiple programs providing the functionality to start installed applications, to manage open windows and virtual desktops, and often to support a widget engine.
Modern versions of the Microsoft Windows operating system use theWindows shell as their shell. Windows Shell providesdesktop environment,start menu, andtask bar, as well as agraphical user interface for accessing the file management functions of the operating system. Older versions also includeProgram Manager, which was the shell for the 3.x series of Microsoft Windows, and which in fact shipped with later versions of Windows of both the 95 and NT types at least through Windows XP. The interfaces of Windows versions 1 and 2 were markedly different.
Desktop applications are also considered shells, as long as they use a third-party engine. Likewise, many individuals and developers dissatisfied with the interface of Windows Explorer have developed software that either alters the functioning and appearance of the shell or replaces it entirely.WindowBlinds byStarDock is a good example of the former sort of application.LiteStep and Emerge Desktop are good examples of the latter.
Interoperability programmes and purpose-designed software lets Windows users use equivalents of many of the various Unix-based GUIs discussed below, as well as Macintosh. An equivalent of the OS/2 Presentation Manager for version 3.0 can run some OS/2 programmes under some conditions using the OS/2environmental subsystem in versions of Windows NT.
"Shell" is also used loosely to describe application software that is "built around" a particular component, such as web browsers and email clients, in analogy to the shells found in nature. Indeed, the (command-line) shell encapsulates the operating systemkernel. These are also sometimes referred to as "wrappers".[2]
Inexpert systems, a shell is a piece of software that is an "empty" expert system without the knowledge base for any particular application.[16]
^"The Internet's fifth man", Brain scan,The Economist, London:Economist Group, December 13, 2013,Mr Pouzin created a program called RUNCOM that helped users automate tedious and repetitive commands. That program, which he described as a "shell" around the computer's whirring innards, gave inspiration—and a name—to an entire class of software tools, called command-line shells, that still lurk below the surface of modern operating systems.
^abRaymond, Eric S. (ed.)."shell".The Jargon File.
^Wheeler, Sean (14 October 2018)."Running Remote Commands".Microsoft Docs. Microsoft. Retrieved30 June 2019.You can run commands on one or hundreds of computers with a single PowerShell command. Windows PowerShell supports remote computing by using various technologies, including WMI, RPC, and WS-Management.