Okay now that we had a quick overview of colonics I want to spend some time talking about the Linux
terminal so you can access the terminals through this application right here so if you click on that
it'll open the terminal window for us.
And as you can see all it is is a black screen where you can type commands.
Now the Linux terminal is actually very very powerful because it can be used to do anything that you
can think of really.
A lot of the applications in Linux that have a graphical interface where command prompt programs first
and then people made a graphical interface for it.
So a lot of the time maybe the graphical interface will be buggy or crash and the terminal program will
still work.
Also a lot of the penetration testing tools do not even have a graphical interface.
A lot of them can only be used throughout the terminal.
Not only that but in many scenarios you might only have an S-sh or a command prompt access to a machine.
So you need to know how to use this command prompt in order to achieve your goals.
So throughout the course we're going to be using the terminal a lot.
And that's why I want to spend some time just showing you the basics of it and making sure that you're
going to be comfortable using it.
Now the basic idea is you type a command and the result will be displayed for you on screen.
So let's have a look on a very very simple command which is p w d.
Now this command prints the current working directory has the name P.W..
So if I hit enter you can see it's print and forward slash route which means right now I'm in the root
directory.
So basically I'm in here this is the route.
It's home.
So if I do ls which is a command to list all the directories and files in the current working directory
we should get all of these directories that we've seen here.
So if I had to enter as you can see I can see all these directories in the current working directory.
Now another very useful command is DCD command this command allow us to navigate into another directory.
So for example let's say I want to navigate into the downloads.
All we have to do is type C followed by the name of the directory that I want to navigate to.
So I'm going to type downloads now if I hit enter I should be inside the downloads now.
So if I do PWT to see my current working directory you'll see that it's saying I'm in route forward
slash downloads so if I do ls here it should show me all the directories and files inside downloads.
So if I do enter as you can see I have a directory and the file in here.
And these are the exact same files that you'll see if you double click the downloads here.
Now if you want to go back one directory.
So similar to press and the back button in here.
All you have to do is do a CD.
Again the command to change the working directory followed by dot dot.
And now if I do PWT you'll see I'm back in road and if I do ls you'll see all the directories and files
and root.
So that's all good.
And there's actually a huge number of commands that you can use.
So I'm going to include a link in the resources of the structure of all the Linux commands that you
can use.
You don't need to know them by heart.
We're actually going to be using a lot of them throughout the course.
So you're going to naturally learn them as you go through the course.
Now if you are using a command and you're not sure about how this command works you can just use the
man command to display the manual of this command.
For example we've used the ls command here to list the files and directories in the current working
directory.
But if I do mine followed by LS This basically means I'm requesting the manual of ls.
So I'm asking how can I use the ls command.
So if I hit Enter you'll see I'll get a screen similar to a text file and basically it's given me a
lot of information on how to use the ls command.
So you can see that it's telling us that this command will list the directory contents.
You can see the way it works by type in LS followed by the options followed by a file if you if you
want to run it on a file you can see a longer description of the command and then you can see all the
options and the arguments that we can use with this command now in Linux.
Most of the time the options will always follow the same syntax.
So either use dush letter or dash dash a word to specify the argument for example and here the dash
A and dash dash all will ignore entries starting with dot.
So if you keep going down in here you'll see all the options and arguments you can use with the ls command
and we have another example.
Here we have the dash L which means it's going to use a long listing format which will display more
information about the files in the current working directory.
So let's have a look on that.
I'm going to press Q to exit this and then we're going to do ls as usual.
And since we read the manual we know we can do dash L to see more information about the files.
And if I hit Enter now you can see I'm still getting the same directories but it's also shown me the
permissions of the users that they've created and so on.
So you can use the man command on any command you want.
Not only on the LS.
So you can use it on the PWT you can use it on the CD or any other command and it'll show you full description
or the manual page of how to use this command.
Now I'm going to clear the screen by typing clear.
And the next thing that I want to show you is the dash dash help.
So this is something that you can use again and almost all commands and all programs in Linux so you
can just type the program name or the command name followed by Didache help as you might think this
will show you help message telling you what this command is or what this program is.
The arguments that it takes how to use these arguments aren't examples at the bottom.
Now another useful thing with the term and also I'm going to clear this again is the arrows.
So you can press up to go up to see all the commands that we executed before.
And again you can go down to see to navigate between the commands that you executed previously.
You can also use the tab for auto complete.
So again let's do ls and you can see all the files and let's say we want to go into documents so we
can do cd followed by documents.
You can type documents or if you're lazy like me you can just do d o c and press tab.
And as you can see it's automatically completing the rest of the work for me.
So this is something that comes very very handy when you're using the terminal for a long time.
Now what I also want to show you is how to install programs and Cali from the terminal.
So first I'm going to clear this and the first thing that you want to do is update the sources where
Akali can search and download programs from.
So we're going to do apt get update now up get is the name of the application that allows us to download
and install programs.
And we're saying update because I'm saying that I want you to update the list of all the programs that
I can install so I'm going to hit enter.
And you want to make sure that you have internet connection when running this.
And as you can see it's telling me that it's done and now we can go ahead and start and stolen applications.
So the first program that I want to install is actually a terminal program so similar to this one but
it allows us to have multiple terminal windows open and the same window.
So in order to install a program through the command line we're going to do apt get which is again the
name of the program that allows us to install programs on the system.
We're going to say that I want to install and the program that I want to install is called Terminator
so very very simple.
First of all we're type in the name of the command which is apt get.
We're saying that I want to install and the program name that I want to install is called Terminator.
So I'm going to hit enter.
And this is going to download and install Terminator for me.
So you can use the same command to install any programs that you want.
You just need to replace Terminator with the name of the program that you want to install now.
I've already downloaded and installed this before so it didn't ask me to confirm but if you're running
this for the first time it might ask you to confirm whether or not you actually want to install this
program.
So all you have to do is press y from the keyboard and hit enter.
Now as you can see it's done.
So if I go to my all applications in here and just type Terminator you can see that I have it here.
So I'm actually going to drag it and put it in my dark so I can access it easily in the future.
So now I can just click it in here and that will open Terminator for me.
Now this is another application that allow me to run commands.
So it's exactly the same as this.
So again I can do ls and P.W. D The only difference is with this one I can actually right click and
click on split horizontally for example and this will split the same screen into two screens where I
can run commands at the same time so I can have some commands in here and I can run commands in here.
And then I can even split this more if I want again vertically or horizontally.
And as you can see I can have as many terminal windows as I want and this will be very helpful in the
future when we'll be running a number of programs and a number of commands at the same time.