GUI vs. CLI

Written by Full-Stack Developer

September 21, 2024
GUI vs. CLI

Communication between entities transpires due to different elements. In the case of communication between computers and users, it happens through something called ‘the Interface.’

The interface is a component of the operating system, and the operating system is considered the most important software that runs on the computer. The OS is responsible for the hardware and software resources in the computer.

Different operating systems have different interfaces; where the user and the computer interact. In this article, we will be expanding on the types of interfaces. But first…

Understanding the Basics of Interface / User Interface


An interface is a device or program that enables a user to communicate with the computer. Think of the interface as a point of contact between entities.

A user interface (UI), on the other hand, is an interface designed and created for users to interact with the machine or computer. It is the space where interaction between humans and machines occurs, allowing the user to give instructions (input) and see the response (output).

Imagine turning on your computer without a screen, how can you interact with the computer or see what the computer presents to you?

It is necessary to see what task you are performing, otherwise, how do you know exactly what you’re doing? This is why the visual or user interface (where communication occurs, and can be seen visibly) is of utmost importance.

With user interfaces, you can:

  • Copy, delete, and rename files
  • Sort and search for files and folders
  • Multi-task (open more than one application)
  • Customize the display (screen display images, resolution, background layout, etc.)
  • Access the computer’s built-in help functions.
  • Check network connectivity, and troubleshoot issues.
  • Interact with external devices (scanners, printers, speakers, etc)
  • Perform different tasks (creating documents, performing calculations, etc.)

There are two main types of interfaces: GUI (Graphical User Interface) and CLI (Command Line Interface).

What is GUI?


A Graphical User Interface allows interaction with the computer using graphics. These graphical means include; windows, menus, icons, and pointers, which significantly minimize keyboard use.

Before the introduction of GUIs, users instructed the computer using only text (non-graphical user interface, command line interface, or character user interface) to give instructions to the computer.

This meant that users without technical know-how wouldn’t have been able to use the computer easily because the non-graphical interface required specified text or commands for tasks like installing and instructing programs, system management, etc.

Let’s create a folder, in this case, we’ll interact with a window-based computer.

create a folder in windows

Click on the mouse to get the option to create a folder. After creating the folder, you can access the contents simply by double-clicking to open the folder.

double-click to open the folder

This is a taskbar, and it contains icons. These icons are the GUI of the Windows operating system allowing users to interact with different elements without the need to type out text commands. For example, a folder is signified by a yellow file on the taskbar.

Components of Graphic User Interface [GUI]


  • Window: A window is a viewing section on the computer display screen showing the user programs being run.

  • Menus: Menus are a list of options presented via the menu bar to the computer user to help find or execute a program.

  • Icons: Icons are tiny graphical representations or pictograms displayed on a computer screen to help users navigate a computer.

  • Pointers: Pointers or cursors (in terms of computing) is an indicator that shows the current position on a computer monitor or a symbol or graphical image that echoes the movements of pointing devices. Users can navigate the GUI using pointing devices like a mouse, trackball, fingers (touch screen), stylus pen, etc.

90%

💰 90% OFF YOUR FIRST MONTH WITH ALL VERPEX RESELLER HOSTING PLANS

with the discount code

MOVEME

Use Code Now

Characteristics of Graphics User Interface [GUI]


There are various key characteristics of graphical user interfaces, to mention a few;

  • Sophisticated Visual Presentation: It is said to be sophisticated because it presents a rich display of complex elements. These elements are presented to users in a visual representation, making them easy to work with. The visual element of the screen permits the display of text, images, icon’s and more.

  • Client-Focused Design: Client-focused design means that it was patterned with users in mind and the structure is for easy navigation, and customization. This allows users to personalize their windows with layouts, and themes, to enhance user satisfaction.

  • Pick and Click Interaction: Pick and Click refers to the use of pointers/cursors with pointing devices like a mouse, touchscreen, or touchpad to interact with the graphical elements of the GUI. Users can click, double-click, right-click, left-click, and drag /drop elements.

  • Object Orientation: A graphical user interface is designed around objects, which are things users can see and interact with on the screen. When the object is clicked on for instance, the user performs an action associated with the object. Examples are toolbars, menus, etc.

    Objects are composed of sub-objects for instance an object can be a folder and the sub- object is a .txt file.

  • Restricted Set of Interface Options (WYSIWYG): This means that users are only exposed to a limited interface option on their screen. The concept fosters, “what you see is what you get,” meaning that users are shown exactly what they can do, reducing cognitive stress and unnecessary options and enabling faster decision-making and clarity.

  • Visualization: Visualization is a cognitive process that allows users to understand the function of a program easily. Through graphical representations, users can tell what a particular program does. For instance, when a user sees an Icon of a video player, users can tell by intuition it’s function without the need for detailed text.

Benefits and Limitations of Graphics User Interface


Benefits

GUI is visually appealing: This means it has prettier features that make it easy for users to interact with.
User-friendly: Unlike text-based interfaces, users without technical skills can interact with the computer.
Graphical user interfaces allow users to perform multiple tasks simultaneously, allowing users to switch from one application to another.
Users can customize the visual orientation of elements based on their preferences.
Limitations

Requires more memory to run programs.
GUI takes longer to execute certain tasks and commands, such as installing programs, configuring system settings, etc.
GUI depends heavily on hardware and drivers. If the GUI doesn't recognize the driver, it may lead to errors. For example, graphic card drivers.

What is CLI?


The command line interface also known as “the command prompt or terminal” is a text-based environment that requires the usage of text to perform various operations. Before the introduction of GUI, the terminal was the only way to interact with the computer.

Different operating systems come with their command line interface for example;

  • Windows: Command Prompt / PowerShell
  • macOS: Mac Terminal e.g. bash or zsh
  • Linux: Linux Terminal e.g. zsh, fish, bash

Let’s look at what the command line interface looks like, and in our example, we’ll be using a Windows computer. Here are resources on how to get started with Linux and macOS terminals.

In Windows to view the command prompt, you can simply click on the Windows key and R button. The view should look like the image below.

click on the Windows key and R button

If you look closely, you’ll see c:\Users\LENOVO - this is simply telling us our current location on the computer.

current location on the computere these folders using the Windows command prompt; we would have to use a co

In the above image, we created a folder named NoteTakingApp, and inside the folder, we created a subfolder. Using the GUI - we simply have to click on the folders to open them up. Also, we can see the location of the folders at the very top -

C:\Users\LENOVO\Desktop\NoteTakingApp\sub folder

  • c: Is the storage device

  • Users: Is the top-level directory or folder on C: drive

  • Lenovo: Is the user directory - named after the user account on the system

  • Desktop: This is within the user directory and is a common folder where files and shortcuts on the desktop are located

  • Note-Taking App: This is a directory or folder located on the desktop

  • Subfolder: The subfolder is a subdirectory or sub folder inside the note taking app directory

If we wanted to navigate these folders using the Windows command prompt; we would have to use a command named cd - change directory.

  • cd Desktop
cd Desktop
  • cd NoteTakingApp
cd NoteTakingApp
  • cd subfolder
cd subfolder

The subfolder is currently empty, let’s add a .txt file via GUI and then try to view the content using the Command prompt.

add a .txt file via GUI

Let’s use the command “dir” to tell us exactly where we are on the computer, and list the content of the current directory.

command “dir”

If you look closely, you’ll see the verpex .txt file we created earlier in the subfolder. You can return to the NoteTakingApp directory by typing the command “cd..”

This moves you back up a directory, or we can say “..” represents one folder above your current location.

back up a directory

To move up two directories, type the command cd....

You can also do the same in Windows PowerShell, however, the command is different.

Windows PowerShell

The same command cd was used to navigate through the different folders, but, to print the current directory, we used the command “pwd (Print Working Directory)”, and to list the content in the directory we used the command “ls (list)”.

You can see in the above image that “ls” shows us the directory, and the file inside it.

There are more complex commands, however, these are just the basics to show what actions can be performed in the CLI.

Characteristics of Command Line Interface


  • Text-Based: CLI is text-based which means it relies heavily on the use of text, therefore there are text command syntaxes that must be strictly adhered to.
  • Fast Command Execution: CLI was designed to perform tasks quickly because it requires few resources. For example, it doesn't render graphics like the GUI, which allows it to have more resources to execute commands.
  • Scripting Capabilities: CLI offers scripting capabilities - users can create and execute scripts. These scripts are sequences of commands stored in a file that can be used to automate commands, fostering customization, reusability, etc.
  • Piping and Redirection: Piping allows users to send the output of one command as input of another.

    Redirection allows users to redirect input and output commands to and from files, as well as connect multiple commands into pipelines.

    This provides a flexible way for users to tailor command execution according to their needs and requirements.

  • Command History: CLI generally provides command history, and users can review, recall, or review previous commands.

Benefits and Disadvantages of Command Line Interface


Benefits

Scripting programs or software programs (batch files)/ tools can be used to automate frequently used commands.
CLI requires fewer system resources - for instance, text-based commands use little memory to execute commands.
It is fast in executing commands/tasks like - software installation and package management, text processing, etc.
The user interface doesn’t change; it is consistent in behavior, which can be an advantage depending on the user.
Limitations

The learning curve is steep for users who don’t understand the commands and syntax in navigating this interface.
It is heavily text-based, meaning many individuals with certain disabilities may find it inaccessible.
It’s not as visually appealing as GUI, and there’s very little you can do with customizing the look, which can be a limitation depending on the user.

Summary


The ability to easily use digital devices was made possible with graphical user Interfaces - we can click buttons, scroll, and perform actions. GUI provides the foundation for our interaction with modern devices, even as more modern technology like projection mapping, holographic displays, virtual and mixed realities, etc. arises.

Compared to the more intuitive GUI, the CLI is the foundation of executing programs and plays a significant role in computing in terms of executing programs, and managing the system, etc.

It is strongly type-based, which means you must follow specific commands or programs to execute them. However, the commands are usually short and don't require typing lengthy texts, and the text displayed on the screen is easy to read.

The GUI and CLI both have different uses. Depending on the computer, one can either or both.

20%

💸EXTRA 20% OFF ALL VERPEX CLOUD WEB HOSTING PLANS

with the discount code

AWESOME

Save Now

Frequently Asked Questions

What operating systems are supported?

Verpex supports a wide range of Linux distributions, including Ubuntu, CentOS, Debian, and more, giving you the flexibility to choose your preferred OS.

Do different operating systems require different SMTP port configurations?

SMTP port configurations are generally consistent across different operating systems. The choice of SMTP port depends more on the email client and server settings than the operating system.

Can Golang run without OS?

Yes, it is possible to run Golang programs without an operating system using a technique called "bare-metal programming" or "bare-metal development".

What role does user interface (UI) design play in the effectiveness of browser push notifications?

UI design significantly influences notification effectiveness. Clear, visually appealing notifications with concise messaging and compelling calls-to-action enhance user engagement. Consistent UI across browsers fosters a positive user experience.

Jivo Live Chat