WEBVTT

00:01.080 --> 00:07.080
OK, now that we had a quick overview of colonics, I want to spend some time talking about the Linux

00:07.080 --> 00:12.150
terminal so you can access the terminal through this application right here.

00:12.150 --> 00:15.640
So if you click on that, it will open the terminal window for us.

00:16.080 --> 00:20.610
And as you can see, all it is, is a black screen where you can type commands.

00:21.990 --> 00:28.350
Now, the Linux terminal is actually very, very powerful because it can be used to do anything that

00:28.350 --> 00:35.250
you can think of really a lot of the applications and Linux that have a graphical interface where command

00:35.250 --> 00:40.120
prompt programs first and then people made a graphical interface for it.

00:40.620 --> 00:46.260
So a lot of the time, maybe the graphical interface will be buggy or crash and the terminal program

00:46.290 --> 00:47.190
will still work.

00:48.300 --> 00:53.730
Also, a lot of the penetration testing tools do not even have a graphical interface.

00:53.860 --> 00:57.220
A lot of them can only be used throughout the terminal.

00:58.350 --> 01:05.430
Not only that, but in many scenarios you might only have an SS hech or a command prompt access to a

01:05.430 --> 01:05.950
machine.

01:06.360 --> 01:11.170
So you need to know how to use this command prompt in order to achieve your goals.

01:12.210 --> 01:15.630
So throughout the course, we're going to be using the terminal a lot.

01:15.840 --> 01:22.200
And that's why I want to spend some time just showing you the basics of it and making sure that you're

01:22.200 --> 01:23.980
going to be comfortable using it.

01:25.200 --> 01:30.860
Now, the basic idea is you type a command and the result will be displayed for you on screen.

01:31.890 --> 01:35.400
So let's have a look on a very, very simple command, which is P.

01:35.500 --> 01:36.390
W.D..

01:37.650 --> 01:42.020
Now, this command prints the current working directory has the name P.

01:42.030 --> 01:42.790
W.D..

01:43.530 --> 01:50.110
So if I hit enter, you can see it's printed forward slash root, which means right now I am in the

01:50.160 --> 01:51.380
road directory.

01:51.960 --> 01:54.390
So basically I am in here.

01:54.570 --> 01:55.440
This is the route.

01:55.440 --> 01:56.040
It's home.

01:57.490 --> 02:04.240
So if I do lose, which is a command to list all the directories and files in the current working directory,

02:04.600 --> 02:07.960
we should get all of these directories that we see in here.

02:09.390 --> 02:15.840
So if I had enter, as you can see, I can see all these directories in the current working directory.

02:17.040 --> 02:25.020
Now, another very useful command is this command, this command allow us to navigate into another directory.

02:25.620 --> 02:29.400
So, for example, let's say I want to navigate into the downloads.

02:30.420 --> 02:37.200
All we have to do is type Khedive, followed by the name of the directory that I want to navigate to.

02:37.620 --> 02:39.180
So I'm going to type download.

02:41.000 --> 02:42.230
Now, if I hit enter.

02:43.210 --> 02:49.810
I should be inside the downloads now, so if I do need to see my current working directory, you'll

02:49.810 --> 02:53.530
see that it's saying I'm in rude forward slash downloads.

02:54.430 --> 02:59.970
So if I do, let's hear it should show me all the directories and files inside downloads.

03:00.400 --> 03:07.060
So if I do enter, as you can see, I have a directory and the file in here, and these are the exact

03:07.060 --> 03:10.240
same files that you'll see if you double click the downloads here.

03:12.590 --> 03:19.670
Now, if you want to go back one directory so similar to pressing the button in here, all you have

03:19.670 --> 03:25.310
to do is do KDDI again, the command to change the working directory, followed by the DOT.

03:26.570 --> 03:27.680
And now if I do P.

03:27.720 --> 03:30.320
W.D., you'll see I'm back in route.

03:30.650 --> 03:34.610
And if I do Ellyse, you'll see all the directories and files and root.

03:35.940 --> 03:41.650
So that's all good and there's actually a huge number of commands that you can use.

03:41.880 --> 03:48.090
So I'm going to include a link in the resources of this lecture of all the Linux commands that you can

03:48.090 --> 03:48.510
use.

03:48.960 --> 03:50.650
You don't need to know them by heart.

03:50.760 --> 03:53.310
We're actually going to be using a lot of them throughout the course.

03:53.580 --> 03:57.630
So you're going to naturally learn them as you go through the course.

03:58.950 --> 04:04.650
Now, if you are using a command and you're not sure about how this command works, you can just use

04:04.650 --> 04:08.670
the mind command to display the manual of this command.

04:09.600 --> 04:14.580
For example, we've used the command here to list the files and directories and the current working

04:14.580 --> 04:15.150
directory.

04:15.720 --> 04:24.240
But if I do mine followed by ls this basically means I'm requesting the manual of URLs, so I'm asking

04:24.240 --> 04:26.040
how can I use the command.

04:27.090 --> 04:34.620
So if I had enter you'll see I'll get a screen similar to a text file and basically it's given me a

04:34.620 --> 04:37.860
lot of information on how to use the command.

04:38.790 --> 04:43.260
So you can see that it's telling us that this command will listed directory contents.

04:43.950 --> 04:48.780
He can see the way it works by type in ls followed by the options, followed by a file.

04:48.780 --> 04:55.950
If you if you want to run it on a file, you can see a longer description of the command.

04:57.190 --> 05:03.520
And then you can see all the options and the arguments that we can use with this command.

05:04.840 --> 05:11.530
Now and Lennix, most of the time, the options will always follow the same syntax, so you either use

05:11.530 --> 05:20.080
the letter or dash dash a word to specify the argument, for example, and hear the dash, a dash dash,

05:20.080 --> 05:24.670
all will ignore entries, starting with dot com.

05:25.180 --> 05:32.170
So if you keep going down in here, you'll see all the options and arguments you can use with the command.

05:33.280 --> 05:35.620
And we have another example here.

05:35.620 --> 05:43.090
We have the dash URL, which means it's going to use a long listing format which will display more information

05:43.090 --> 05:45.760
about the files in the current working directory.

05:46.870 --> 05:48.090
So let's have a look on that.

05:48.100 --> 05:53.050
I'm going to press cue to exit this and then we're going to do list as usual.

05:53.440 --> 05:59.680
And since we read the manual, we know we can do Dush URL to see more information about the files.

06:00.130 --> 06:05.740
And if I hit enter now, you can see I'm still getting the same directories, but it's also showing

06:05.740 --> 06:10.000
me the permissions, the users, the data created and so on.

06:11.230 --> 06:17.530
So you can use demand command on any command you want, not only on the URLs so you can use it on the

06:17.530 --> 06:25.540
P W.D. You can use it on the CD or any other command and it'll show you full description or the manual

06:25.540 --> 06:28.240
page of how to use this command.

06:30.000 --> 06:33.300
Now I'm going to clear the screen by typing clear.

06:34.970 --> 06:38.290
And the next thing that I want to show you is the dash dash help.

06:38.870 --> 06:44.780
So this is something that you can use again in almost all commands and all programs and Linux.

06:45.140 --> 06:50.870
So you can just type the program name or the command name, followed by Dash Dash Help.

06:52.590 --> 06:58.440
As you might think, this will show you a health message telling you what this command is or what this

06:58.440 --> 07:05.100
program is, the arguments that it takes, how to use these arguments and examples at the bottom.

07:06.380 --> 07:11.630
Now, another useful thing with the terminal, so I'm going to clear this again is the arrows so you

07:11.630 --> 07:16.280
can press up to go up to see all the commands that we executed before.

07:16.430 --> 07:22.430
And again, you can go down to C to navigate between the commands that you executed previously.

07:23.630 --> 07:26.690
You can also use the tab for autocomplete.

07:27.260 --> 07:30.260
So, again, let's do Ellas and you can see all the files.

07:30.500 --> 07:36.980
And let's say we want to go into documents so we can do Khedive followed by documents.

07:37.130 --> 07:44.200
You can type documents or if you're lazy like me, you can just do Deacy and press tab.

07:44.690 --> 07:49.480
And as you can see, it's automatically completing the rest of the world for me.

07:50.520 --> 07:55.710
So this is something that comes very, very handy when you're using the terminal for a long time.

07:56.960 --> 08:02.410
Now, what I also want to show you is how to install programs and Karlee from the terminal.

08:03.140 --> 08:08.780
So first I'm going to clear this and the first thing that you want to do is update the sources where

08:09.110 --> 08:11.930
you can search and download programs from.

08:13.190 --> 08:16.550
So we're going to do about get an update.

08:17.720 --> 08:23.390
Now, up is the name of the application that allow us to download and install programs.

08:23.720 --> 08:29.780
And we're saying update because I'm saying that I want you to update the list of all the programs that

08:29.780 --> 08:30.770
I can install.

08:31.730 --> 08:36.530
So I'm going to hit enter and you want to make sure that you have Internet connection when running this.

08:37.370 --> 08:44.180
And as you can see, it's telling me that it's done and now we can go ahead and start installing applications.

08:45.170 --> 08:49.910
So the first program that I want to install is actually a terminal program.

08:49.910 --> 08:57.110
So similar to this one, what it allow us to have multiple terminal windows open and the same window.

08:58.220 --> 09:04.550
So in order to install a program through the command line, we're going to do up to get which is, again,

09:04.550 --> 09:08.950
the name of the program that allow us to install programs on the system.

09:09.590 --> 09:16.580
We're going to say that I want to install and the program that I want to install is called Terminator.

09:18.550 --> 09:19.670
So very, very simple.

09:20.170 --> 09:25.270
First of all, we're typing the name of the command, which is up get, we're saying that I want to

09:25.270 --> 09:29.920
install and the program name that I want to install is called Terminator.

09:30.850 --> 09:31.900
So I'm going to hit Enter.

09:33.780 --> 09:40.290
And this is going to download and install Terminator for me so you can use the same command to install

09:40.290 --> 09:41.700
any programs that you want.

09:42.000 --> 09:46.950
You just need to replace Terminator with the name of the program that you want to install.

09:48.200 --> 09:54.530
Now, I've already downloaded and installed this before, so it didn't ask me to confirm, but if you're

09:54.530 --> 10:00.320
running this for the first time, it might ask you to confirm whether or not you actually want to install

10:00.320 --> 10:01.040
this program.

10:01.340 --> 10:05.240
So all you'd have to do is press away from the keyboard and hit enter.

10:06.140 --> 10:11.270
Now, as you can see, it's done, so if I go to my all applications in here.

10:12.800 --> 10:20.120
And just type Terminator, you can see that I have it here, so I'm actually going to drag it and put

10:20.120 --> 10:24.640
it in my dog so I can access it easily in the future.

10:26.680 --> 10:31.450
So now I can just click it in here and that'll open Terminator for me.

10:32.410 --> 10:36.040
Now this is another application that allow me to run commands.

10:36.250 --> 10:38.590
So it's exactly the same as this.

10:38.890 --> 10:40.630
So, again, I can do less.

10:40.630 --> 10:45.610
And W.D., the only difference is with this one, I can actually.

10:45.610 --> 10:45.880
Right.

10:45.880 --> 10:49.540
Click and click on Split Horizontally, for example.

10:50.650 --> 10:57.310
And this will split the same screen into two screens where I can run commands at the same time so I

10:57.310 --> 11:00.910
can have some commands in here and I can run commands in here.

11:02.250 --> 11:09.750
And then I can even split this more if I want again, vertically or horizontally, and as you can see,

11:09.750 --> 11:12.570
I can have as many terminal windows as I want.

11:12.780 --> 11:18.240
And this will be very helpful in the future when we'll be running a number of programs in a number of

11:18.240 --> 11:20.030
commands at the same time.

11:21.610 --> 11:27.280
Now, before I let you go, I just want to show you two websites that I'm going to include in the resources

11:27.280 --> 11:28.060
of this lecture.

11:28.840 --> 11:34.450
First of all, we have a website here that includes the most common Linux commands, if not all.

11:34.780 --> 11:37.840
So you can go through them and familiarize yourself with them.

11:38.020 --> 11:41.260
But keep in mind, you don't need to know them all by heart.

11:41.440 --> 11:47.380
Like I said, as you go through my course and as you continue on with your journey, you will learn

11:47.380 --> 11:49.660
the commands that you need as you go.

11:51.140 --> 11:56.160
Another really useful resource that I'm going to include is explaining shell dot com.

11:56.690 --> 12:00.130
This website is designed to explain Linux commands to you.

12:00.410 --> 12:02.700
So all you have to do is type the commands in here.

12:02.930 --> 12:11.450
So, for example, if you just type Élysées and hit explain it, explain that less well, less directory

12:11.450 --> 12:18.770
content, you could make it more complex and do less dash L.A. and if we hit enter now, it will break

12:18.770 --> 12:21.980
all the arguments and explain every single argument.

12:22.250 --> 12:28.400
So again, all this contents, if we highlight the URL, as you can see, it's telling us that it's

12:28.400 --> 12:31.550
going to use a long listening format, as we've seen earlier.

12:31.730 --> 12:38.810
And the AI at the end is the same as Dyche AI, which is all, which means that we do not want to ignore

12:38.810 --> 12:40.570
entries starting with a dot.

12:40.670 --> 12:42.890
So we do not want to ignore hidden files.

12:44.030 --> 12:50.360
So you can do any command in here, you can do up get installed, for example, and it'll actually explain

12:50.360 --> 12:55.880
it to you, so it'll explain what is a package manager installed can be used to install packages and

12:55.880 --> 12:56.370
so on.

12:56.750 --> 13:01.190
So if you ever see a Linux command that you don't understand, you can always just come in here, put

13:01.190 --> 13:05.690
the command and it'll break it down to you and explain it really nicely.
