A Tour into CLI.
Tags: webdev, javascript, programming, tutorial
Published: 2022-11-15 09:45:41

##Understanding The CLI As a BEGINNER

###Brief History
In the 1960s, the use of computer terminals was first introduced, this was the only design pattern to interact with computers. In the 1970s and 1980s, command line input was commonly used by Unix systems and PC systems like MS-DOS and Apple DOS. It does not support the use of a mouse, the user inputs the command through the keyboard and the computer executes the instruction.
The essence of this article is to get you an understanding of basic CLI commands used during most development processes by software engineers. Every developer, during their journey as a software engineer, Web developer, Android, and Embedded system programmer must always come across the use of commands in their terminals to create packages and bundles for tooling their application.  This makes development processes faster and handier. Nevertheless, you should have an understanding or clearer interpretation of what each line does as well when navigating across each directory.

###What is CLI
Let's look into the acronym CLI, which stands for any of the followings;
- Command Line Interface
- Command line Interpreter
- Command Line Input

This is a command line program that accepts text input to execute operating system functions. CLIs are often used by programmers and system administrators, in engineering and scientific areas of discipline, and by technically advanced personal computer users. It consists of Syntax and Semantics: 

###The Syntax Of CLI: 
Syntax is the grammar that all commands must follow. They're a set of rules that the command must follow and also dictate how a user navigates through the system command. 

###The semantics of CLI: 
Semantics define what sort of operations are possible, on what sort of data these operations can be performed, and how the grammar represents these operations and data. Here, it is the symbolic meaning of syntax
A typical example of this is 
- DOS command `C:\>`
- Linux Command `>`
- NPM commands `C:\>npm install packages` or `> npm install packages`

Try out this command to know who it is, that the PC you’re using represents
Prompt `c:\>  Whoami`
![checking your pc name with cli](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tjomvv8g3m4chohq5s7m.PNG)
###The GUI
The command line existed before the GUI which is presently widely used. It's very much a great deal to discuss the GUIs as well.
GUI is simply the graphical user interface, The innovative design of GUI limited the use of command lines in later years as program executions and applications now use beautifully designed UI/UX to run applications at a click. With the GUI, most users never experience the use of the command line interface.

###The Concept of CLI
With the widely used GUI, the command line Interface still plays a vital role in usage for software engineers, statisticians, and engineers of different fields such as embedded system designers.
####The command-line 
The parameter is an item of information provided to a program when it is started. A program can have many command-line arguments or parameters that identify sources or destinations of information, or that alter the operation of the program.
This source and destinations can be navigated with the use of two attributes parts namely the
_Prompt: 
Which is always the initial state prompting the user to key in a command._
_Command Line: 
Which consists of the command, option or flag, the file specification, and switches_
For example; With the CLI you can navigate to display a picture gallery. Using the parameter 
`Prompt > command line (this includes command and filespec)` there are some hands-on command lines to try out using your PCs.


![Navigating with CLI](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i357dek1ma6a0tztj43m.jpg)
###Using the command prompt parameter

- Change directory _(CD)_
This is used to change paths and navigate to a specific directory or folder. 
`Prompt> cd pictures `

- Change the directory backward in one step _(CD ..)_
Using the dot-dot space after the _CD_ changes directory to the previous or preceding folder moving it one level up
`Prompt> cd ..`



- Change directory to root directory _(CD /)_
This will navigate you to the root directory of the command prompt if you’re already in the picture directory or move to root
`Prompt> pictures> cd /`

- To create a new directory _(MKDIR or MD)_
This command is used to create a new directory in a specified location
`Prompt> cd desktop/mkdir New folder` 

- To remove a directory of the folder _(RMDIR or RD)_
This command will remove a created folder from its location
`Prompt> rmdir newfolder`

- To clear up the screen _(cls or clear)_
This command is used to clear up the screen after multiple commands have been executed. However, with the keyboard up, and down arrow keys previously cleared commands can be reused.
`Prompt > cls`
- To close and exit windows _(EXIT)_
Prompt > exit

- To get Help on a command use _(HELP)_
This will display the number of commands to be used to navigate the cli
`Prompt > help`

####Types of CLIs
There are two common types of command Line interface
- Operating system (OS) command-line interfaces are usually distinct programs supplied with the operating system. A program that implements such a text interface is often called a command-line interpreter, command processor, or shell. E.g.  DOS' Windows CMD.EXE programs

- Application programs (as opposed to operating systems) may also have command-line interfaces.
Some applications support a CLI, presenting their own prompt to the user and accepting command lines. Other programs support both a CLI and a GUI.

##Conclusion
The use of a command line interface can not be overemphasized. As this could be very relatable to any level of techies during the building of applications where the use of Node Package Manager (npm) CLI parameters are mostly used to install packages and bundle over different thousands of open source npm packages at a go. Such as the CLIs for creating Angular, React, Express, and flutter wave applications. You're encouraged to learn more about the use of CLI for your developments