3: The Terminal

Day 2: Talking to the computer in the old fashioned way!

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):

  • CLI

  • 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.

Some useful commands I learned today:

COMMANDMEANINGHOW IT'S USED
~a Tilde, represents the home directory
clearcleans out the Terminal, provides a clean slateJust type, "clear"
historyshows your previous work (after you've cleaned out a Terminal)Just type, "history"
pwdPrint Working Directory, tells you the full path name of the directory you are inJust type, "pwd"
cdChange Directory, allows you to move into a different directorycd academy
mkdirMake Directory, create a new directorymkdir coder
lsList, this command lists the files and folders in the location you are inJust type, "ls"
touchCreate a new filetouch manoj.txt
moreShows the contents in a filemore manoj.txt
mvMove a file or Rename a filemv manoj.txt emanoj.text
.a single dot represents the current directory
..double dots take you 2 levels above
cpCopy or duplicate a filecp emanoj.text emanoj-copy.text
rmRemove - delete a filerm emanoj-copy.txt
manManual - if you want detailed documentation on a specific commandman rm

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