Understanding Command-line interface (CLI)

Share this article

When I started my Linux journey, the very basic question that comes to my mind was when I saw another person using the CLI interface like others.

“Why don’t you just use an application with a good-looking GUI? / Why don’t you use the mouse or the touchpad? It barely takes a second to move the cursor and double click on a gorgeous icon to open the applications!”

Now after spending some time working with Linux systems now I can say that why CLI is important

Why CLI is Important ?

There are many reasons which can argue why CLI is better and important than GUI. Here are few important ones:

  1. Automation: It is common for a administrator to handle many servers. Administring these server from GUI is cumbersome and time consuming. In that case scripts are used, which contains list of things to do and CLI commands are major part of the scripts.
  2. Composability: The output of one CLI command can be used as a input to different commands. Building a composable GUI which can perform this type of action is a hard problem.
  3. Flexibility: In CLI you can use any number of option provided with the command. However, in a GUI, providing beyond 3 – 4 levels of depth of menu, and maybe upto 10 – 15 options at a given depth, can make the GUI very hard to use.
  4. Resources: Running GUI is much more resource consuming because each GUI component need to be shown pictorially. GUI does a lot of work to show you the pictorial views. For storing the data and process this pictorial data need more computing resources.
  5. Speed: CLIs run a lot leaner and do what it needs to do no other things like showing nice results in GUI. Therefore, it much more faster then GUI.

How to run Linux commands

All the Linux/Unix commands are run in a shell.  Linux/Unix commands are case-sensitive. 

The terminal can be used to accomplish all Administrative tasks some of the tasks are following.

  • Package installation
  • File manipulation
  • User management.

Running commands is also depends on permission assigned to the users. The root user can run any commands and can access any files. For Linux user understanding checkout Important commands for user management with examples.

CLI example

Ubuntu terminal example

In Ubuntu, we use the terminal that is a command-line interface. The above mention snapshot shows the ubuntu terminal with the ls command and its output. Ubuntu Terminal is also commonly known as Shell, Console, Command Prompt, or CLI.

For important commands check the Linux Commands page.

Leave a Comment

Your email address will not be published. Required fields are marked *