CommLineLit:Learning Module
Introduction to Command Line Interfaces
Many operating systems rely upon some type of command line interface (CLI). CLIs allow users to interact with computer software by typing commands, often combining a series of commands to achieve a goal. Commands may interact in intricate ways, with the output of each command processed by another. For this reason, CLIs are utilized for complex tasks by system administrators, computer programmers, and researchers in a variety of fields.
The CLI is the predecessor of the graphical user interface (GUI). Although the CLI may seem outdated, it is a powerful tool for interacting with computer software.
Unix and Unix-like operating systems (such as Mac OSX and Ubuntu Linux) contain command line shells or "terminals" as an integral part of the system. Windows has historically utilized DOS as its CLI, but recent releases have assigned it a minor role and removed it from the core of the operating system. However, the CLI has been reinvigorated on Windows systems by the Windows PowerShell.
Examples of CLIs
Advantages of CLIs
Command line interfaces have several advantages when contrasted with GUIs:
- In a CLI, all options and operations are invoked in a consistent form. In GUIs, similar operations often appear on different menus with different interfaces. Different GUI applications generally incorporate different approaches to interface design, with visual cues (such as icons) conflicting.
- If the CLI is robust, all options and operations are documented. This means that it is no more difficult to perform a rare operation than a common one.
- CLI commands allow for shell scripting and can perform operations in a batch processing mode without user interaction. That means that once an operation is analyzed, it can be saved in a script and consistently performed without further effort. With GUIs, users must start over at the beginning every time, and GUI scripting is more limited (and often nonexistent). Simple CLI commands do not even need a script, as the completed command can often be assigned a name and executed simply by typing that name into the CLI.
- In modern operating systems, GUIs hide many complex actions and configuration options. CLIs allow users to access these actions and options, configure/customize their systems to a greater degree, secure their system and investigate security vulnerabilities, and debug and potentially fix problems that arise.
Value of Command Line Literacy
Today, many users prefer to use GUIs to perform common operations and have little or no knowledge of CLIs. This is an unfortunate consequence of GUI popularity, and relegates many users to the role of simply a consumer, unable to take full advantage of the software they have become increasingly reliant upon.
Even basic understanding of CLIs is an important skill to possess, one that empowers users and may potentially open new doors for a future profession. The Internet relies heavily upon CLIs for its operation, and most web servers do not have GUIs installed. Given the prominence of CLIs and their important role in computer systems, command line literacy is a valuable tool.
Brainstorming Questions
- Have you ever utilized a command line interface? If so, what were the positive and negative aspects of the CLI?
- What are some possible scenarios where it might be better to use a CLI than a GUI? When might it be better to use a GUI than a CLI?
- What do you think is the future of the CLI?
chmod Tutorial
To become familiar with the command line, it is best to begin with a simple command. The chmod
command is common to all Unix systems, and illustrates basic concepts about the Unix filesystem. Understanding chmod
will better prepare you to utilize the CLIs in most operating systems (which are generally Unix or Unix-like).
Note: Before beginning the Learning Activities, it is highly recommended that you complete the chmod tutorial using the link below.
Click Here to Access the chmod Tutorial The link above will open in a new window. |
Supplementary Material
To better understand chmod
and Unix file permissions, these resources may be helpful:
Next Step
After completing the chmod Tutorial, please continue to the Learning Activities.