Command-Line Interface
What is a command-line interface?
A command-line interface (CLI) is a text-based user interface (UI) used to run programs, manage computer files and interact with the computer. Command-line interfaces are also called command-line user interfaces, console user interfaces and character user interfaces. CLIs accept as input commands that are entered by keyboard; the commands invoked at the command prompt are then run by the computer.
Today, most vendors offer the graphical user interface (GUI) as the default for operating systems (OSes) such as Windows, Linux and macOS. Most current Unix-based systems offer both a command-line interface and a graphical user interface.
The MS-DOS operating system and the command shell in the Windows operating system are examples of command-line interfaces. In addition, programming language development platforms such as Python can support command-line interfaces.
The command line dropped in popularity following the introduction of GUI-based personal computer OSes like Microsoft Windows and Apple's "classic" Mac OS in the 1980s. The command line remains an important tool for IT professionals, software developers, sys admins, network administrators and many others who prefer a more precise and reproduceable interface to their systems.
What is a shell?
In computing, a shell program provides access to an operating system's components. The shell gives users (or other programs) a way to get "inside" the system to run programs or manage configurations. The shell defines the boundary between inside and outside.
The following are the two types of operating system shells:
Bash is the most commonly used command-line shell for Unix-based OSes including Linux.
The software that handles the command-line interface is commonly referred to as a command language interpreter, a command processor or command interpreter. Two well-known CLI shells are PowerShell for Windows and Bash for Linux and macOS.
Recommended by LinkedIn
Shells are the outermost layer of the OS and are often separated from the underlying OS kernel. A shell operates like an application and can be replaced as needed. An OS may have more than one shell available, as in the following examples:
Because the shell is only one layer above the OS, users can perform operations that are not available in other interface types, such as moving files within system folders and deleting locked files.
To get the greatest benefit from using a CLI shell, users should learn a scripting language. Most command line shells can save sequences of commands in a script or batch file which may be fully programmable. Shell scripting is the foundation of basic systems management automation.
How do CLIs work?
Once a computer system is running, its CLI opens on a blank screen with a command prompt and commands can be entered.
Types of CLI commands include the following:
CLI is more than a simple command/response system, as most have additional features that make one preferable to another. Some features include the following: