I Command Thee...
Tags: unix, linux, cli, ubuntu
Published: 2021-10-11 12:48:51

The Command Line
	
   Can anyone tell me what day of the week Christopher Colombus landed in what is now the Bahamas? A quick Google search will tell you that he arrived on October 12th, 1492. But, it doesn’t mention the day of the week.  The answer happens to be Friday. And, if you make it to the end of this article, I will show you how I used the command line to find out the answer.

   In honor of Indigenous People’s Day, I figured I would use a little bit of history to teach you about a topic you’re probably not interested in. The command line interface.
So, what is and why should someone learn the command line? It seems dated, right? It pukes lines of noisy text that bother the eyes and confound the mind.

   The command line is a powerful tool that can be used to interact with a computer’s operating system. It can access information in a computer’s file system. It can interact with an application’s database.  It can make API calls(e.g. Git). In fact, it can do many of the tasks that a typical graphical user interface or GUI can do. 

   The command line interface(CLI) dates all the way back to the 60’s and was the primary means of communication between a person and a computer. As computers became more complex and PC’s became more widespread, the CLI evolved into computing tasks based on UNIX and eventually Linux-based distributions. 

   When we hear the words Unix and Linux, they typically refer to how software interacts with hardware. Otherwise known as kernels, Unix and Linux are the source of truth for operating systems. They define a set of standards and processes that make up the functionality of modern computing. Though they are similar, Linux is a clone of Unix, has different commands and is more geared towards an open-source community where ideas and technology can be shared freely.

   When a user interacts with a kernel it is done through a shell. Some examples of shells are bash, zsh, powershell, COMMAND.com. Once the shell is entered, it opens with a terminal(CLI) which is a program that runs the shell. It displays a prompt which varies between different shells but typically will have the username and the hostname(computer name). At the prompt, it takes in a command. This is where the magic happens. 

   A command is made of several parts not all of which are required.
1.	Command: what you are asking the program to execute
2.	Options: specifications for your command to operate on the argument
3.	Argument: the value for which the command is executing upon.

   To answer my question from earlier I’m going to open up Ubuntu, which is a Linux distribution.
```javascript
joetags@DESKTOP-R7QGGNP:~$ cal october 1492
    October 1492
Su Mo Tu We Th Fr Sa
    1  2  3  4  5  6
 7  8  9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31

joetags@DESKTOP-R7QGGNP:~$
```

   The cal command prints a calendar in the console. The arguments passed in specify the month and the year for the command to print. If none were entered, it would print the current month and highlight the current day as well.

   While this is basically a parlor trick for the true potential of the command line. If you have any Git experience you’re already aware of how you can transfer/update files to another server. Essentially, the command line can interact with the entire life cycle of your application. From initialization to deployment. 
   This article only scratches the surface of the command line’s potential. It gives a brief explanation of what it is and how it evolved. Hopefully, some of the concepts and terms discussed provided clarity and intrigue for an often overlooked tool. Happy coding!