Back
Command Line Interface (CLI)

By Sean Toru | last updated 28th December 2020


C

Command Line

What is the Command Line ?

The Command Line or Command Line Interface (CLI) is a text interface that allows the user to type line by line commands into the computer. Although it may seem daunting to newcomers, the CLI is the most direct and powerful way to interact with a computer.

When you are using a CLI you are typing a set of specific text based commands, which collectively are called a ‘shell’. An example shell command is ‘cd ~/Downloads ’ which can be translated into ‘goto my downloads folder’. It’s identical in nature to double clicking the ‘documents’ folder on a Mac. Then from there you might run `ls`which would list out all of the files in the downloads folder, or ‘touch my-file.txt’ which would create a new text file.

Anything that you can do on a computer using the graphically orientated operating system you can do from the CLI as well. And because the commands you write are simple lines of text this means you can quickly and easily build up sets of commands into ‘shell scripts’ that can be run again and again.

The CLI is also a really handy way to communicate with a remote web server. You would first establish a secure ‘SSL’ connection to the server, and then the text commends you run will control the remote computer, rather than your local one. This is how most developers and engineers interact with Linux based web servers, rather than via any kind of graphical user interface (GUI).

There are different types of ‘shell’. Bash is a very popular shell that runs on MacOS and Linux. PowerShell is an equivalent on Windows.

Related Terms

Do you want to contribute to this page?