A Beginners Guide to the Command Line Interface (CLI)

Skylar Lorena
3 min readMay 18, 2022

--

You might be wondering “What is a CLI and why exactly do we use it?”

Often, a user’s first experience with a computer is through GUIs(Graphical User Interface)where visual components(icons) represent potential user actions. It is more common and user friendly since we only use a mouse and a keyboard for navigation throughout the machine. Although easier to use, a GUI is considered slower due to more visual output, which requires more memory than a text-based CLI. In this article, we will:

  • Define “Command Line Interface”
  • Describe the purpose of CLIs
  • Identify the key difference between graphical user interface, command-line interface terminal and shell.

Let’s get to it!

What is a CLI, aka Command-Line Interface?

The command line, or command-line interface (CLI), is a text-based interface that allows you to type commands via lines of text that are then executed by the computer. Within a CLI, advanced tasks can be efficiently carried out, so every IT and Cybersecurity professional needs to be familiar with the command line and be proficient in its navigation. Depending on whether you use Windows or Mac/Linux, there will be differences in the CLI.

Purpose of CLIs

CLI is known for power, speed and ability to accomplish a vast array of tasks with a single command-line instruction. No matter what type of development, coding, programming, or IT task you do, there’s value in understanding the command line. The advantages of a command-line interface are:

  • greater control of an OS or application;
  • faster management of many operating systems;
  • ability to store scripts to automate regular tasks;
  • basic command-line interface knowledge to help with troubleshooting, such as network connection issues.

The command line may not be ideal for every computer user because it requires memorized commands to use its interface. The disadvantages of a command-line interface are:

  • GUI is more user-friendly;
  • A steeper learning curve associated with memorizing commands and complex syntax/arguments;
  • different commands used in different shells.

Identify the key difference between graphical user interface, command-line interface, terminal and shell.

When using programs with graphical user interfaces (GUI), certain buttons perform certain tasks on the computers. The command line interface does that too, but it allows you to do it with more precision and power.

To work with the command-line, you simply launch a terminal program, type words and hit enter, the shell(bash and zsh) interprets those words, and works with the OS kernel and files to execute the command.

shell
GUI

Conclusion

Choosing a GUI or a CLI is dependent on the purpose. Casual/new users would prefer a GUI because it is easier and more comfortable whereas experienced users and professionals are more likely to use a CLI because of the benefits it has, such as remote access and the ability to run scripts. Interaction ultimately depends on the user and the purpose behind using the machine. Whatever the case, being familiar with CLI is essential to professionals in tech.

Here are some cheat sheets and tutorials to get you started!

Command Line Crash Course by Sven

https://gist.github.com/hofmannsven/8392477

Linux Command Line Cheat Sheet by DaveChild

How to Use the Command Line Interface by Issa Sangare

https://medium.com/swlh/how-to-use-the-command-line-interface-cli-9c8b70e568e

--

--

Skylar Lorena

I am a mobile and full-stack software engineer and artist. Currently working as a Software Development Technical Mentor at Moringa School. Check out my Music!