We’re continuing our Computer Basics series, and this week we’re exploring the Graphical User Interface and the Command Line Interface.
The Graphical User Interface (GUI)
A GUI (pronounced “gooey) is a visual way for users to interact with computers, using graphics, icons, windows, and menus. Users perform their tasks by clicking, dragging, and dropping (releasing the mouse button) elements on the screen. The GUI is an intuitive and user-friendly method of operation, which makes it easier for users, especially new users, to navigate and use computers. Because you can see the options available to you on the screen, the GUI reduces (but not quite eliminates) the need to memorize complex commands and text-based interactions, which I’ll cover in just a few minutes.
The GUI consists of icons on the desktop, taskbars along the bottom, the start menu, buttons to click, checkboxes, and dialog boxes that pop up and ask you to make a selection. Users can use these components to do things like opening programs, managing their files, and change the settings in a program or in the system itself. You use a GUI if you use the Windows Desktop, the macOS desktop, or the graphical environments in a Linux distribution like Unity or GNOME.
There are some advantages of using a GUI instead of a text-based interaction method. A GUI offers a visual representation of data and actions. It’s one thing to know something, it’s another thing to actually see it. The GUI simplifies complex tasks and workflows by breaking them down into manageable graphical elements. The GUI is a front end for commands. When you click on something or drag and drop something, the GUI kicks off the command to perform that action, which happens “behind the scenes” and provides you a visual representation of what’s going on back there. GUIs can also provide visual cues, tooltips, and confirmation dialogs that help prevent user errors and minimize accidental actions. They also offer feedback mechanisms, like progress bars and status indicators, that inform users about ongoing processes, which can reduce confusion and frustration.
Two underused and less-understood components of a GUI are the Windows Taskbar and the Windows Start Menu. The Taskbar is a GUI component that displays running applications, system notifications, and quick access to commonly used tools. Users can pin favorite programs to the taskbar, as well as often-used files. The Start Menu provides access to applications, settings, files, and search functionality. There are a lot of ways a GUI can be customized to suit your individual preferences, like display settings, organizing your desktop layouts, and choosing a them. Icons, wallpapers, and color schemes can all be personalized.
The Command Line Interface (CLI)
The Command Line Interface (CLI) lets users interact with the computer by typing commands. Commands are textual instructions that perform specific actions or operations on the computer. The CLI works through a command prompt or terminal window where users type text commands to perform tasks. CLI provides direct control over system functions, file management and software operations through the command the user types. The user can run commands to do things like copy, move, create, and delete files and folders, install and remove software, and make changes to system settings. The CLI is commonly used for writing scripts for automating tasks, where a sequence of commands can be saved as a file to use for repeated execution. Scripts can automate complex process, batch operations, and system maintenance tasks. While a GUI provides a convenient way to execute commands, there are almost always more commands available to use than are found in the GUI.
The CLI consumes fewer system resources than the GUI uses, and that makes it a real benefit when you’re dealing with resource-limited environments like servers or embedded systems (I’ll probably do a post later on embedded systems). System Administrators (like me) like to use CLI, as do many developers and power users. The CLI is really efficient and flexible, and very often there are options available when using CLI that aren’t available in a GUI. Essentially, when you’re clicking a button on a GUI, you’re telling the system to run a command of some kind, which would have the same effect if you opened the command prompt and typed the command itself.
Using a CLI, though, requires that you learn specific commands, the syntax (think “grammar” – putting things into the right place in the command or using the right descriptors, flags, or tags), and conventions (does the capital/lower case state matter, knowing when to use “two” and when to use “2”, etc). Having to learn those things can be present a steep learning curve, which is magnified if you lack confidence. If you take the time to learn it, it can help you gain greater control, efficiency, and more customization options than you’ll have with the GUI.
The black-box command prompt isn’t the only form of CLI. Windows PowerShell is also a CLI, the Shell in Linux, and the Terminal in macOS and Linux are all versions of a CLI. CLI is a powerful tool for users who require more precise control, automation capabilities, and efficient and effective resource management in their computing environments.
Here are a few examples of some well-known commands:
- cd: Change directory
- ls (Linux and macOS) or dir (Windows): List files and directories
- mkdir: Make Directory, or create a new directory
- rm (Linux and macOS) or del (Windows): remove or delete a file
- cp (Linux and macOS) or copy (Windows): copy files or directories
- mv (Linux and macOS) or move (Windows): Move or rename files or directories
- grep (Linux and macOS): search for text or patterns
- chmod (Linux and macOS): change file permissions
- sudo (Linux and macOS): run a command with administrative privileges
Executing a command typically shows the results on the screen, which is fine for simple commands that don’t generate a lot of text. However, there are times when we want to perform a command, and then have the results do something else or become available for another command to use. In those cases, we can use the | symbol or the “Pipe” which is the “upper case” version of the backslash (\), or we can use the > or >> to send the results to a printer or a file. For example, if a command is going to produce so much output that it’s going to scroll up the screen and I won’t be able to see it all, I can send the results to a simple text file that I can open and read much more easily. Pipelines, which is what we call using a command with a pipe, help us automate tasks, or process batches of commands.
CLI is essential for development and programming. Developers write and compile code, manage version control systems, debug their code, and eventually deploy the software package. The CLI makes for efficient workflows for coding and testing.
We use CLI extensively in administering servers. Copying large groups of files and folders is facilitated using the robocopy command, providing a way to bypass some of the limitations imposed when trying to perform the same action in a GUI. We also use it to test connections and processes, and to perform a host of administrative tasks. Many of our configurations are automated by creating a PowerShell script to execute configuration tasks. Using a script prevents errors in typing and ensures the same process is repeatable no matter who is doing it.
Next time we’ll go into some basic, but essential, skills you can learn to enhance your experience in using your computer.
If these sessions are helpful, drop a comment below.
1 thought on “Exploring the GUI and the CLI”
Comments are closed.