Log in Sign up
Back to Discover
💻

Command-line interface

technology Maturity 7-9 war conflict
This article covers sensitive topics: war_conflict. Parents can manage visibility in Parental Controls.

You can talk to computers with words.

Linux command-line. Bash. GNOME Terminal. screenshot.png
Linux command-line. Bash. GNOME Terminal. screenshot.png
You type a line of text. Then the computer does a job. This helps people do work fast. It is like magic! Do you like typing?

39 words

You can talk to computers with words.

Linux command-line. Bash. GNOME Terminal. screenshot.png
Linux command-line. Bash. GNOME Terminal. screenshot.png
You type a line of text. Then the computer does a job.

This way of talking is called a command line. You type a command. The computer reads it and acts.

COMMAND LINE.svg
COMMAND LINE.svg

It is very fast for some people. You can save many commands in a file. Then the computer runs them all at once. This is called a script.

Most people use pictures and icons today. But many experts still use words. It helps them do hard work.

Windows PowerShell 1.0 PD.png
Windows PowerShell 1.0 PD.png

It is a very useful tool for computers.

105 words

You can talk to computers using text. This is called a command-line interface, or CLI.

Linux command-line. Bash. GNOME Terminal. screenshot.png
Linux command-line. Bash. GNOME Terminal. screenshot.png
Instead of clicking icons, you type a command. A command is a specific instruction.
COMMAND LINE.svg
COMMAND LINE.svg
A special program called an interpreter reads your text. It then carries out the task you asked for.

Most people use a graphical user interface today. This uses pictures, windows, and icons to work.

Gem 11 Desktop.png
Gem 11 Desktop.png
However, the CLI is still very useful. It uses less power from the computer system. Experts often find it faster to type short commands. You can also use scripts to do work. A script is a file that holds many commands. The computer runs them all as one group. This helps people finish repetitive tasks very quickly.
Windows PowerShell 1.0 PD.png
Windows PowerShell 1.0 PD.png

Some programs have both types of tools. For example, a math program might have icons. But it also lets you type commands. This gives you even more ways to use it.

GNUOctave430.png
GNUOctave430.png
The CLI is a powerful way to control computers.

174 words

A command-line interface, or CLI, is a way to talk to software using text.

Linux command-line. Bash. GNOME Terminal. screenshot.png
Linux command-line. Bash. GNOME Terminal. screenshot.png
Instead of clicking on pictures, you type specific lines of text called commands. This is also known as a command-line shell. While most people use a graphical user interface (GUI) today, the CLI is still very important. Many tools for making software or managing operating systems rely on it. It is a direct way to tell a computer exactly what to do.
COMMAND LINE.svg
COMMAND LINE.svg

How does this text-based system work? It relies on a program called a command-line interpreter. This interpreter acts like a translator that reads your typed instructions and carries them out. A typical command line has a few different parts. First, there is a prompt, which is a symbol that shows the computer is ready for you to type. Next, you type the command itself. You can also add parameters, which are extra pieces of information. These parameters can be arguments or options that change how the command works.

COMMAND LINE.svg
COMMAND LINE.svg

This way of working has a long history. In the mid-1960s, people used computer terminals to interact with machines. Before that, they often used punched cards, which were not interactive. In 1964, a man named Louis Pouzin created a tool called RUNCOM. He used the word "shell" to describe using commands like a programming language. Later, Glenda Schroeder developed the first Multics shell. In 1971, Ken Thompson created the first Unix shell at Bell Labs.

Version 7 UNIX SIMH PDP11 Kernels Shell.png
Version 7 UNIX SIMH PDP11 Kernels Shell.png

There are many different types of shells used today. For example, the Bourne shell was introduced in 1977. This led to the popular Bash shell used in many places. Windows users might use CMD.EXE or Windows PowerShell, which was released in 2006.

Windows PowerShell 1.0 PD.png
Windows PowerShell 1.0 PD.png
On a Mac, the default shell is Z shell. Many people use the CLI because it uses fewer system resources than a GUI. It can also be much faster for experts to type short commands than to click through menus.
Gem 11 Desktop.png
Gem 11 Desktop.png

The CLI is great for doing many things at once. You can write a script, which is a file containing a group of commands. The computer can then run that whole script as one single program. This makes it very easy to automate repetitive tasks. Some programs, like the math tool GNU Octave, offer both a GUI and a CLI.

GNUOctave430.png
GNUOctave430.png
This allows users to choose the best way for their work. Even people with visual disabilities can use a CLI with special Braille displays.

428 words

A command-line interface (CLI) is a method of interacting with software by typing formatted lines of text.

Linux command-line. Bash. GNOME Terminal. screenshot.png
Linux command-line. Bash. GNOME Terminal. screenshot.png
Also known as a command-line shell, this interface allows users to communicate directly with a computer. While most modern users interact with computers through a graphical user interface (GUI), the CLI remains a vital tool. It is widely used for software development, system administration, and managing operating systems. Because it relies on text rather than complex graphics, it is a highly efficient way to control powerful computing systems.

The mechanism of a CLI depends on a program called a command-line interpreter. This interpreter, or command processor, acts as the middleman that executes the user's input.

COMMAND LINE.svg
COMMAND LINE.svg
A typical interaction begins with a prompt. The prompt is a visual cue, often a symbol, that indicates the system is ready for input. The user then types a command, which is the specific instruction to be performed. Commands can be internal, meaning they are built directly into the interpreter, or external, which are separate executable files located elsewhere on the system. Users can also include parameters, such as arguments or options, to provide extra information to the command. The interpreter follows specific rules of syntax, or grammar, and semantics, which define the meaning of the operations.

There are several distinct types of command-line interfaces used in computing. Operating system shells are programs provided with the OS to manage its core functions. Examples include various Unix shells like Bash, ksh, and zsh, or Windows programs like CMD.EXE and Windows PowerShell.

Windows PowerShell 1.0 PD.png
Windows PowerShell 1.0 PD.png
Application command-line interfaces are different because they belong to specific software programs rather than the operating system itself. Some applications, like the numerical tool GNU Octave, provide both a GUI and a CLI.
GNUOctave430.png
GNUOctave430.png
In these cases, the GUI might actually be a visual wrapper around a separate CLI executable file. Some applications may even offer more features through the CLI than through their GUI.

The history of the CLI is rooted in early teleprinter (TTY) machines. In the mid-1960s, these terminals provided a more interactive alternative to the non-interactive method of using punched cards. Mechanical teleprinters were eventually replaced by "glass TTY" systems, which used a keyboard and screen. In 1964, Louis Pouzin developed the RUNCOM tool at the MIT Computation Center. Pouzin coined the term "shell" to describe using commands like a programming language. Following his work, Glenda Schroeder developed the first Multics shell in 1965. In 1971, Ken Thompson developed the first Unix shell, the V6 shell, at Bell Labs.

Version 7 UNIX SIMH PDP11 Kernels Shell.png
Version 7 UNIX SIMH PDP11 Kernels Shell.png
This was later followed by the introduction of the Bourne shell in 1977, which paved the way for modern shells like Bash.

Using a CLI offers significant advantages in terms of efficiency and resource management. A CLI requires fewer system resources to implement than a GUI, making it ideal for systems with limited hardware. For experienced users, typing a few characters to access a command option can be faster than navigating through multiple menus.

Gem 11 Desktop.png
Gem 11 Desktop.png
One of the most powerful features of a CLI is automation through scripting. A script is a file that stores a sequence of commands. These commands can be executed together as a single program, allowing users to automate repetitive tasks. This is often paired with line editing and history mechanisms, which allow users to review or repeat frequently used command sequences.

CLIs are used across many specialized fields and by diverse groups of people. Programmers and system administrators rely on them for coding and managing large-scale server environments. Engineers and scientists use them for technical computations and data processing. Even people with visual disabilities find CLIs helpful, as the text-based responses can be displayed using refreshable Braille displays. The interface is also essential for inter-process communication, where command lines from one process are redirected to another using methods like standard streams or named pipes.

The evolution of the CLI reflects the broader history of computing architecture. As the microcomputer revolution occurred, hardware terminals were replaced by terminal emulators. These are software programs on a PC that interpret signals to connect to larger mainframe or minicomputer systems. Today, the CLI continues to evolve, as seen in the 2006 release of Windows PowerShell. This version combined traditional Unix shell features with the object-oriented .NET Framework. Whether through a terminal emulator on macOS or a specialized shell on Windows, the CLI remains a fundamental way to command the digital world.

750 words
🖼️ Images & Media (10)
File:Linux command-line. Bash. GNOME Terminal. screenshot.png
Linux command-line. Bash. GNOME Terminal....
File:Windows PowerShell 1.0 PD.png
Windows PowerShell 1.0 PD.png
File:Gem_11_Desktop.png
Gem_11_Desktop.png
File:GNUOctave430.png
GNUOctave430.png
File:Version 7 UNIX SIMH PDP11 Kernels Shell.png
Version 7 UNIX SIMH PDP11 Kernels Shell.png
File:Hard_reset_BBC_Micro_32K_Acorn_DFS.gif
Hard_reset_BBC_Micro_32K_Acorn_DFS.gif
File:COMMAND LINE.svg
COMMAND LINE.svg
File:RT-11 help.jpg
RT-11 help.jpg
File:TTY33ASR.jpg
TTY33ASR.jpg
File:Terminal-dec-vt52.jpg
Terminal-dec-vt52.jpg
Up Next
💻
Graphical user interface
Technology
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.