The first question that comes to everyone who has heard about GUI is, why CLI? When we have such beautiful GUI/UIs then why we want to go backward with CLI. In this post, we shall explore the same. We shall discuss What is CLI? Why CLI? and How is it better than GUI?

Introduction

CLI is an acronym for Command Learning Interface. A CLI is a minimal interface where we type some command and boom; something happens. But wait, why are we switching back to old fashioned CLI? Isn't it the same reason why we improved the GUI to make computers more accessible? Hmm, Yes.

History

First, let's explore GUI, what is it? And what does it take to make a good GUI? Initially, when the computers began to rise. We did not have enough resources, both computational and software-wise to make a good GUI. If you remember, the earlier version of the computers was not meant for the general public. Rather the computers were used solely for scientific and business applications. So, if anyone wanted to use a computer they must know how to write code or at least the knowledge of CLI was a pre-requisite. But with the generalization of the computer automatically introduced a need to make a simple interaction system with the computers so that those who just want to use the functionalities may use it, right out of the box. Without the need to know the coding and expertise.

Bob creates a Visual Basic Program to open the gate in Stranger Things.

And, since then GUI or Graphical User Interface is on the verge. Improving with time. Easing the usability of the computers. But we need to understand one more thing. As said everything comes with some cost. The same goes for the GUIs as well. It uses a lot of resources to manage the UI. It is not an issue for a normal user because nowadays every hardware is manufactured considering it.  But still, we have several CLI options, especially in Linux Systems.

A CLI interface in Manjaro OS

So let's say I want to restart my network manager I will open the settings, look for network settings, will find an option to restart the manager, and finally restart it. We may imagine that it will take time for sure to make the necessary UI changes/updations in the screen. Will, not this be better if we could do it in one go?

Yes, with CLI we can. For example, to do the same in Ubuntu Linux we have to open a terminal and type

sudo systemctl restart network-manager

And like this, there are plenty of such commands which ease our day-to-day operations. CLI is lightweight and mainly useful in servers and for development tasks. For example, to open a project folder in Visual Studio Code we have to type

code location/of/folder

No need to open file explorer, and double-clicking folder and folder and folder, and then right-clicking on the folder and selecting, open with "Visual Studio Code".

It is so convenient, right?

In a nutshell

Basic CLI Commands

Another reason is that cloud server are mostly dominated by Linux OS. And we don't want any GUI load uses in the system as it is not required. Rather, what do we need is, only an option to connect with the server via SSH so that we may perform some actions with the CLI.

Linux

Is CLI, Linux? Well, NO. CLI is a way to interact with an Operating System such as Linux, Windows, or Mac.

Then what is Linux?

Linux is an open-source Operating System. It is quite popular among developers for its being the lightweight OS and usability/easiness for developers.

Fun Fact: Almost six hundred Linux distributions exist, with close to five hundred out of those in active development.

Just because it has great usability with CLI does not make it ugly in terms of GUI. Linux is great and the fact that it is an open-source project, and people regularly contribute to it makes it even more flexible and solid.