3: Familiarizing with Terminal and Command Line
Published: 2023-10-18 10:45:44

_**Day 2 | Self-study | 2 hours, after work**_

Today, I am learning the below, before the next LIVE lecture:

**- Overview of Terminal**

_Warning: Below are my study notes as I learn and hence I could be wrong here and there. Please correct me where required and my apologies in advance._

**TERMINAL**

This is an interface on a computer that allows you to input text and perform various operations. These inputs are often called Command Lines.

In our day-to-day computer use, we are not used to Terminal because we use graphics to operate a computer. Graphics can be loosely described as the "visual treats" you see on your screen. With these, you can create folders & files, rename, move, and delete them, go to different applications, install and uninstall them, etc. Technically speaking, we interact with the company using a GUI.

GUI = Graphical User interface. Sometimes, people pronounce "GUI" as "Goo-ey".

At this stage, I was curious and wanted to learn a bit more about Terminal, Command Line, etc. So, a Google search led me to freeCodeCamp, and I learned the below:

CONSOLE: Tools to interact with the computer (mouse, keyboard, monitor)

TERMINAL: An environment (or a program) on a computer that allows us to input commands or instructions, and the computer returns a result or an output. 

Did you know? You can install and uninstall a Terminal, and run many Terminals on a computer.

COMMAND LINE: The space where one enters the commands for the computer to perform specific tasks. Sounds like a Terminal, right? It seems they are the same and the terms can be used interchangeably.

So, now we know there are 2 interfaces for an operating system (OS):

1. CLI
2. GUI

Question: If GUI is easy to use and understand, why even bother with a CLI, especially for a programmer?

Because it's more efficient and quicker, you can automate tasks, and perform repetitive tasks, and in some cases, there's no other way to interact with a computer in a deep technical sort of way.

When you enter a Terminal, you will type your commands after the $ symbol.

I learned some of the common Command Line prompts as well and saw them in action:

**~** - a Tilde, represents the home directory

**clear** - cleans out the Terminal, provides a clean slate

**history** - shows your previous work (after you've cleaned out a Terminal)

**pwd** - Print Working Directory, tells you the full path name of the directory you are in

**cd** - Change Directory, allows you to move into a different directory

**mkdir** - Make Directory, create a new directory
_(mkdir coder - This creates a new folder called, "coder")_

**ls** - List, this command lists the files and folders in the location you are in

**touch** - Create a new file
_(touch manoj.text)_

**more** - Shows the contents in a file
_(more manoj.txt)_

**mv** - Move a file or Rename a file
_(mv manoj.txt emanoj.text)_

**.** - a single dot represents the current directory

**..** - double dots takes you 2 levels above

**cp** - Copy or duplicate a file
_(cp emanoj.text emanoj-copy.text)_

**rm** - Remove - delete a file
_(rm emanoj-copy.txt)_

**man** - Manual, if you want a detailed documentation on a specific command
_(man rm)_

----

Phew! That's it for today. It's 9:30 p.m., and I am so tired and sleepy. Time to hit the sack and rejuvenate!