Command Line Basics — Becoming a Powerful Developer (Part 1)
By: Ilekura Idowu
Tags: Mac, Command Prompt, Windows, Command Line, Linux

Credit Safebytes

Introduction

The two distinct ways of operating the computer system are

Graphical User Interface (GUI) Command Line Interface (CLI)

1 . Graphical User Interface (GUI)

A graphical user interface is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicators such as primary notation, instead of text-based user interfaces, typed command labels or text navigation.

Basically, almost everyone who has interacted with the computer system used the graphical user interface at their first interaction. When you start up any computer system what you will see is the graphical user interface. The mouse is majorly used to interact with the GUI.

An example of a graphical user interface

Most applications provide users with the ability to interact with their services graphically and via the command line(usually through programming). When you chat on Twitter, Facebook, Instagram you will likely be using a graphical user interface but there are options of interacting with these applications without seeing any graphics ( you can check here if you are interested)

Back to the computer graphical user interface, if you were to create a folder on Windows/Linux/macOS what you will simply do is to click on any empty space on your desktop using your mouse, select create a new folder and boom you have successfully created a folder. To delete the folder all you have to do is just to click on the folder and click on delete, easy right? At this point you might be wondering if the command line is important, considering the fact that GUI is simple to use.

Take this scenario as an example, you work at a big technology company, your job requires you to copy files that fall within a specific type (.txt for text) among several files of different types( let’s assume millions) to a folder. I can imagine someone saying well it is easy, just hold your Control button and manually select files of that type and then copy it to that folder. This approach will obviously take some minutes if not hours but with the command line it will take less than a second( depending on your system properties), did I hear a wow shout.

Having seen the importance of the command line let us learn about it.

(2) Command Line Interface/Prompt

A command-line interface (CLI) processes commands to a computer program in the form of lines of text. The program which handles the interface is called a command-line interpreter or command-line processor. Operating systems implement a command-line interface in a shell for interactive access to operating system functions or services. The command line can also be called Terminal, command prompt (it prompts the user to type something/commands). If you are interested in the history of the command line then check here

With the command line you will rarely see graphics and what you will mostly be using to interact is your keyboard. With the command-line interface, you can automate boring kinds of stuff with scripts(which are quite impossible with GUIs). Also, cloud computing is an emerging field and the best method of interacting with the cloud is through the command line E.g Microsoft Azure CLI, Google cloud command line, AWS command line.

As a developer or enthusiast, the knowledge of the command line is sacrosanct, from installing packages( python-pip or Javascript- npm), hosting your websites (think of Heroku CLI), version control( Git & GitHub) and etc. Some months ago I was working with a PostgreSQL database, I tried using PGAdmin( GUI for Postgres) but I kept encountering errors, to solve the challenge I had to use Postgress CLI.

On windows, you can access the command line using Windows Command prompt(pre-installed)/ Powershell(pre-installed too) or download Bash( a Unix shell) you can download Bash(Bourne Again Shell0 here. On Linux/ macOS CLI is pre-installed as terminal, you do not need to download anything.