EP 02 | Start using Terminal
Tags: linux, cybersecurity, tutorial, opensource
Published: 2021-11-10 13:06:35

Hello beautiful people! After a long time, here I bring the 2nd Episode of the Linux for Hackers Series.
Actually, I’m really sorry for the delay, I’m dead busy with my university stuff these days. That’s the reason, Anyway, I try to bring new articles as soon as I can…

When it comes to Terminal, It’s the truly wheeled power of Linux. So please don’t use GUI in Linux. You should use Terminal instead of it.

![Where you can access Terminal in Kali Linux](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b61rhyi0cpxu0nbkd0v1.jpg)

So this is the where Terminal is in Kali Linux. Go ahead and click it…

![Terminal](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vwtutcgeo6ksdozlezko.png)

So you can see here, Terminal opened up!

So this is the Linux Terminal, and this is how you are supposed to use Linux. Now if you’re coming from the GUI-only world Where all you use is a graphical user interface… Right!!!

![fun1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g9zm35utyzs6uv96ccuj.png)

So true, this might seem a little scary. I totally get it!!!
BUT DON’T WORRY!!!

We are going to walk through this, We are going to teach you a few commands here…

I’m going to slowly wing you off the Graphical User Interface.
I’ll put it up side by side…

Actually, watch here. I’m gonna teach your first few Linux commands…
So come on follow along with me…

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/97z16tdrx9rdqjtjq5a7.png)

So go ahead and have your Linux terminal open and also at the same time double click and open up your Home Directory.

![Opened Home Directory and Terminal](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ddprociico7oogsksc0x.jpg)

I’ll teach you the first few commands by doing something here in the GUI and then doing that same thing in the Linux Terminal.

Now here’s the first thing, what I love about the GUI is that you are always kind of know where you are right! because you can see it!!!

![You can see where you are ‘/home/kali/’](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d4d119n02utnp1dwhveb.jpg)

So here I’m in my user directory (Home directory). And you can see there is my stuff.

Now, let’s look at the CLI which is Linux Terminal.

![Terminal](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nvevw0zm6tb77m5nmieg.png)

I don’t see anything here… How do I know I am, We are gonna solve that…
This is our first command! type with me folks!!!

<b>01. pwd (Print Working Directory)</b>

It basically does what we see in the GUI address bar (/home/kali/).
Simply, It tells us where we’re at…
Hey, where am I? Oh! I’m right here!!!
Let’s try it out! type pwd and go ahead and hit enter!

```
pwd
/home/kali/
```
![Compare terminal result and what we can see in GUI address bar](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vkwim8rftg7uhb2f51qx.png)

Bam!!! It shows us the full path of where we are right now!!!… 
you can see it exactly to same as the GUI address bar does.

But one thing, I can actually see my Desktop, Document folder, Download folder, Music folder, Pictures folder, Public folder, Template folder and Videos folder in GUI.
I don’t see those in CLI/ Terminal!!!

How do I see those in Terminal…???

Next command!
type with me, It’s ls command!

<b>02. ls (list)</b>

This is pretty simple what it does. It’ll simply list the contents of your current working directory!
It’s gonna list what we see in GUI… Desktop, Document folder…etc.
You wanna see it?
Let’s do it!

```
ls
Desktop  Documents  Downloads  Music  Pictures  Public  Templates  Videos
```
![ls](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7i2lw1vwfxdq82zq1ml5.png)

Boom!!!
It did everything!

We can see Desktop Documents… all kinds of stuff in Terminal also.

SEE SEE!!! YOU CAN DO ANYTHING IN THE TERMINAL!!!
and it’s faster!!!

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mlpoab4k8n4ntfpyd4f1.jpg)

I’ll convince you, don’t worry! let’s keep going!!!

let’s say we want to take a peek inside our desktop folder. I’ll show it first in GUI. I go inside the Desktop folder.

I know you all know how to do that in GUI.

![go to inside of the Desktop folder in GUI](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vvjen5f6ehieckprsvpj.gif)

I just double-clicked the desktop folder, and I jumped in there…
So, how to do it in the terminal!
Our Next Command! here we go!

<b>03. cd (Change Directory)</b>

It’s going to do exactly what we just did in GUI.
watch let’s do it right now!!!
Just after cd,
I’ll hit space and tell it
what directory do I want to go to…

```
cd Desktop
```
![cd command](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dk7a21i5dwkowicace99.gif)

Hey! Did it work???
I don’t know! Let’s see…
Let’s print our working directory!

![check cd](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7jul9m01intmcbus2xac.gif)

We did!!!
Here you can see the current working directory is changed!!!
We did indeed drill down right into the desktop folder and then to see what’s on our desktop as we can see in the GUI. But currently, my Desktop is empty! Let’s see what happens!!!

we can simply type ls command to list the contents!!!

![ls in desktop](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vlx0mlwrx6ap778h5m7x.png)

There’s not anything!!! in both GUI and CLI!!! It’s fine. Because actually, my desktop has nothing!!! cool!!!

Now!!! We’re gonna learn one more command today!
Hang with me!!!

But so far we’ve done a lot,
the pwd command → to see where we are
the ls command → see what’s around us, what’s in our directory
the cd command → to change where we are

But now,
How do we go back!!!???

Because we can do it in GUI easily using the back icon in the left top corner!

![back in gui](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tj4x8ivu7n30ni11ftii.jpg)

How do we do it in Terminal?!
It’s actually super easy!!!

so again we gonna type <b>cd</b>

because Back means we gonna <b>change our directory again!!!</b>
type cd and I’ll hit space and type double dot and hit Enter!

```
cd ..
```
![go backward](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cofpuxrk01tmqfmekte3.gif)

Boom! it works!!!
Again we were in our home directory!

Now just for fun!
I wonder what will happen if we keep going backward???
if we type in cd .. again and again??? what will happen??

Okay, let’s do it and check!

![Keep going backward](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wdgyomx25omh82zvgxxb.gif)

Oh, you can see, instead of home I’m simply at /
And what this is?

It is actually the Root of the file system.
It’s the end.
We reached the end!

And we’ll talk more about that later! In upcoming episodes!

But, just for fun again… just that’s all for fun right!
let’s enter the ls command now!!! at root… (/)

![try ls command in the root directory](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p0awdr4pn1yrf05kldfr.gif)

Boom! you can see now the content list of the root directory…
Huh! A lot of interesting files here…

We’ll talk about all these files later!

Now real quick Quiz for you,
![Quiz time](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t6umifhv0x5knx0zht8m.jpeg)

Let’s see you got the idea right!
<b><i>Q. Assume you’re in the root directory in Linux Terminal. What command or commands would you enter to /home/kali/ directory?</b></i>

There are 02 options really…
You can do it with one command or you can do it with 02 commands…
<b>Please comment below your answer!!!</b>

I’ll discuss the answer in the very next episode of this series!

Now here we just scratched the surface.
We are going deeper into Linux.
We are gonna prepped and ready to become a hacker.
But don’t that diminish the fact that you did a lot today with this article!

We are moving from GUI to CLI… Specially Hackers like CLI! We love it right!
And we did, pwd, cd, ls… more to come!!!

So if you wanna hack Dev.to platform algorithm, just hit the heart ,unicorn or save and hit the follow button, and also put your comment! 
It hacks the algorithm of Dev.to :D.
Ethically!!! Yess!!!

<h2>Summary</h2>
pwd command → to see where we are
ls command → see what’s around us, what’s in our directory
cd command → to change where we are
cd .. command → to go backward