Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:01,149 --> 00:00:03,210
Okay, now that we had a quick overview
2
00:00:03,210 --> 00:00:06,250
of Kali Linux, I want to spend some time talking
3
00:00:06,250 --> 00:00:08,200
about the Linux terminal.
4
00:00:08,200 --> 00:00:09,930
So you can access the terminal
5
00:00:09,930 --> 00:00:12,120
through this application right here.
6
00:00:12,120 --> 00:00:13,600
So if we click on that,
7
00:00:13,600 --> 00:00:16,140
it'll open the terminal window for us.
8
00:00:16,140 --> 00:00:19,160
And as you can see, all it is is a black screen
9
00:00:19,160 --> 00:00:20,763
where you can type commands.
10
00:00:21,990 --> 00:00:25,580
Now, the Linux terminal is actually very, very powerful
11
00:00:25,580 --> 00:00:28,110
because it can be used to do anything
12
00:00:28,110 --> 00:00:30,220
that you can think of really.
13
00:00:30,220 --> 00:00:32,420
A lot of the applications in Linux
14
00:00:32,420 --> 00:00:34,550
that have a graphical interface
15
00:00:34,550 --> 00:00:37,000
were command prompt programs first
16
00:00:37,000 --> 00:00:40,600
and then people made a graphical interface for it.
17
00:00:40,600 --> 00:00:43,150
So a lot of the time, maybe the graphical interface
18
00:00:43,150 --> 00:00:44,780
will be buggy or crash
19
00:00:44,780 --> 00:00:47,283
and the terminal program will still work.
20
00:00:48,270 --> 00:00:50,755
Also, a lot of the penetration testing tools
21
00:00:50,755 --> 00:00:53,880
do not even have a graphical interface.
22
00:00:53,880 --> 00:00:55,697
A lot of them can only be used
23
00:00:55,697 --> 00:00:57,393
throughout the terminal.
24
00:00:58,320 --> 00:01:00,970
Not only that but in many scenarios,
25
00:01:00,970 --> 00:01:05,140
you might only have an SSH or a command prompt access
26
00:01:05,140 --> 00:01:06,330
to a machine.
27
00:01:06,330 --> 00:01:09,450
So you need to know how to use this command prompt
28
00:01:09,450 --> 00:01:12,180
in order to achieve your goals.
29
00:01:12,180 --> 00:01:13,460
So throughout the course,
30
00:01:13,460 --> 00:01:15,890
we're gonna be using the terminal a lot
31
00:01:15,890 --> 00:01:18,720
and that's why I want to spend some time
32
00:01:18,720 --> 00:01:20,860
just showing you the basics of it
33
00:01:20,860 --> 00:01:24,093
and making sure that you're gonna be comfortable using it.
34
00:01:25,190 --> 00:01:28,160
Now, the basic idea is you type a command
35
00:01:28,160 --> 00:01:31,870
and the result will be displayed for you on screen.
36
00:01:31,870 --> 00:01:34,650
So let's have a look on a very, very simple command,
37
00:01:34,650 --> 00:01:36,563
which is pwd.
38
00:01:37,630 --> 00:01:40,880
Now, this command prints the current working directory,
39
00:01:40,880 --> 00:01:43,530
hence the name pwd.
40
00:01:43,530 --> 00:01:45,180
So if I hit Enter,
41
00:01:45,180 --> 00:01:48,000
you can see it's printing /root,
42
00:01:48,000 --> 00:01:51,980
which means right now I am in the root directory.
43
00:01:51,980 --> 00:01:54,580
So basically, I am in here.
44
00:01:54,580 --> 00:01:56,193
This is the root, it's home.
45
00:01:57,480 --> 00:01:58,920
So if I do ls,
46
00:01:58,920 --> 00:02:02,590
which is a command to list all the directories and files
47
00:02:02,590 --> 00:02:04,600
in the current working directory,
48
00:02:04,600 --> 00:02:06,930
we should get all of these directories
49
00:02:06,930 --> 00:02:08,133
that we see in here.
50
00:02:09,400 --> 00:02:12,110
So if I hit Enter, as you can see,
51
00:02:12,110 --> 00:02:14,270
I can see all these directories
52
00:02:14,270 --> 00:02:16,003
in the current working directory.
53
00:02:17,040 --> 00:02:20,740
Now, another very useful command is the cd command.
54
00:02:20,740 --> 00:02:25,580
This command allow us to navigate into another directory.
55
00:02:25,580 --> 00:02:28,260
So for example, let's say I want to navigate
56
00:02:28,260 --> 00:02:29,583
into the Downloads.
57
00:02:30,420 --> 00:02:32,980
All we have to do is type cd,
58
00:02:32,980 --> 00:02:35,420
followed by the name of the directory
59
00:02:35,420 --> 00:02:37,600
that I want to navigate to.
60
00:02:37,600 --> 00:02:39,363
So I'm gonna type Downloads.
61
00:02:41,000 --> 00:02:43,270
Now, if I hit Enter,
62
00:02:43,270 --> 00:02:45,700
I should be inside the Downloads now,
63
00:02:45,700 --> 00:02:49,550
so if I do pwd to see my current working directory,
64
00:02:49,550 --> 00:02:54,410
you'll see that it's saying I'm in /root/Downloads.
65
00:02:54,410 --> 00:02:56,260
So if I do ls here,
66
00:02:56,260 --> 00:02:57,920
it should show me all the directories
67
00:02:57,920 --> 00:03:00,390
and files inside Downloads.
68
00:03:00,390 --> 00:03:01,990
So if I do Enter,
69
00:03:01,990 --> 00:03:04,180
as you can see, I have a directory
70
00:03:04,180 --> 00:03:05,830
and the file in here
71
00:03:05,830 --> 00:03:07,700
and these are the exact same files
72
00:03:07,700 --> 00:03:10,450
that you'll see if you double click the Downloads here.
73
00:03:12,600 --> 00:03:15,410
Now, if you want to go back one directory,
74
00:03:15,410 --> 00:03:19,200
so similar to pressing the back button in here,
75
00:03:19,200 --> 00:03:20,950
all you have to do is cd,
76
00:03:20,950 --> 00:03:23,600
again the command to change the working directory,
77
00:03:23,600 --> 00:03:25,340
followed by the dot
78
00:03:26,600 --> 00:03:28,770
and now if I do pwd,
79
00:03:28,770 --> 00:03:30,700
you'll see I'm back in root
80
00:03:30,700 --> 00:03:32,160
and if I do ls,
81
00:03:32,160 --> 00:03:34,763
you'll see all the directories and files in root.
82
00:03:35,930 --> 00:03:37,720
So that's all good.
83
00:03:37,720 --> 00:03:40,010
And there's actually a huge number
84
00:03:40,010 --> 00:03:41,870
of commands that you can use.
85
00:03:41,870 --> 00:03:44,170
So I'm going to include a link
86
00:03:44,170 --> 00:03:46,140
in the resources of this lecture
87
00:03:46,140 --> 00:03:48,960
of all the Linux commands that you can use.
88
00:03:48,960 --> 00:03:50,770
You don't need to know them by heart.
89
00:03:50,770 --> 00:03:52,430
We're actually gonna be using a lot of them
90
00:03:52,430 --> 00:03:53,540
throughout the course,
91
00:03:53,540 --> 00:03:56,240
so you're going to naturally learn them
92
00:03:56,240 --> 00:03:57,803
as you go through the course.
93
00:03:58,930 --> 00:04:00,750
Now, if you are using a command
94
00:04:00,750 --> 00:04:03,610
and you're not sure about how this command works,
95
00:04:03,610 --> 00:04:06,060
you can just use the man command
96
00:04:06,060 --> 00:04:09,550
to display the manual of this command.
97
00:04:09,550 --> 00:04:11,910
For example, we've used the ls command here
98
00:04:11,910 --> 00:04:13,700
to list the files and directories
99
00:04:13,700 --> 00:04:15,730
in the current working directory
100
00:04:15,730 --> 00:04:19,500
but if I do man, followed by ls,
101
00:04:19,500 --> 00:04:23,440
this basically means I'm requesting the manual of ls.
102
00:04:23,440 --> 00:04:26,163
So I'm asking how can I use the ls command?
103
00:04:27,070 --> 00:04:28,770
So if I hit Enter,
104
00:04:28,770 --> 00:04:30,990
you'll see I'll get a screen similar
105
00:04:30,990 --> 00:04:33,450
to a text file and basically,
106
00:04:33,450 --> 00:04:35,860
it's giving me a lot of information
107
00:04:35,860 --> 00:04:38,750
on how to use the ls command.
108
00:04:38,750 --> 00:04:40,610
So you can see that it's telling us
109
00:04:40,610 --> 00:04:44,285
that this command will list the directory contents.
110
00:04:44,285 --> 00:04:46,300
You can see the way it works by typing ls,
111
00:04:46,300 --> 00:04:48,770
followed by the options, followed by a file
112
00:04:48,770 --> 00:04:52,090
if you want to run it on a file.
113
00:04:52,090 --> 00:04:56,083
You can see a longer description of the command.
114
00:04:57,260 --> 00:05:00,030
And then you can see all the options
115
00:05:00,030 --> 00:05:03,653
and the arguments that we can use with this command.
116
00:05:04,850 --> 00:05:07,560
Now, in Linux, most of the time,
117
00:05:07,560 --> 00:05:10,470
the options will always follow the same syntax.
118
00:05:10,470 --> 00:05:12,890
So you either use dash letter
119
00:05:12,890 --> 00:05:14,900
or dash, dash a word
120
00:05:14,900 --> 00:05:17,080
to specify the argument.
121
00:05:17,080 --> 00:05:20,593
For example, in here, the -a and --all
122
00:05:20,593 --> 00:05:23,973
will ignore entries starting with dot.
123
00:05:25,150 --> 00:05:27,710
So if you keep going down in here,
124
00:05:27,710 --> 00:05:30,860
you'll see all the options and arguments you can use
125
00:05:30,860 --> 00:05:32,458
with the ls command
126
00:05:32,458 --> 00:05:35,570
and we have another example here.
127
00:05:35,570 --> 00:05:37,130
We have the -l,
128
00:05:37,130 --> 00:05:41,100
which manes it's going to use a long listing format,
129
00:05:41,100 --> 00:05:43,100
which will display more information
130
00:05:43,100 --> 00:05:45,873
about the files in the current working directory.
131
00:05:46,850 --> 00:05:48,070
So let's have a look on that.
132
00:05:48,070 --> 00:05:50,880
I'm gonna press Q to exit this.
133
00:05:50,880 --> 00:05:53,510
And then we're gonna do ls as usual
134
00:05:53,510 --> 00:05:55,290
and since we read the manual,
135
00:05:55,290 --> 00:05:58,670
we know we can do -l to see more information
136
00:05:58,670 --> 00:06:00,190
about the files.
137
00:06:00,190 --> 00:06:01,830
And if I hit Enter now,
138
00:06:01,830 --> 00:06:04,710
you can see I'm still getting the same directories
139
00:06:04,710 --> 00:06:06,760
but it's also showing me the permissions,
140
00:06:06,760 --> 00:06:09,843
the users, the date created and so on.
141
00:06:11,180 --> 00:06:13,070
So you can use the man command
142
00:06:13,070 --> 00:06:14,750
on any command you want,
143
00:06:14,750 --> 00:06:16,480
not only on the ls.
144
00:06:16,480 --> 00:06:18,800
So you can use it on the pwd,
145
00:06:18,800 --> 00:06:20,660
you can use it on the cd
146
00:06:20,660 --> 00:06:22,370
or any other command
147
00:06:22,370 --> 00:06:24,480
and it'll show you a full description
148
00:06:24,480 --> 00:06:28,363
or the manual page of how to use this command.
149
00:06:30,040 --> 00:06:33,523
Now, I'm going to clear the screen by typing clear.
150
00:06:34,990 --> 00:06:36,980
And the next thing that I wanna show you
151
00:06:36,980 --> 00:06:38,850
is the --help.
152
00:06:38,850 --> 00:06:41,640
So this is something that you can use again
153
00:06:41,640 --> 00:06:45,120
in almost all commands and all programs in Linux.
154
00:06:45,120 --> 00:06:47,260
So you can just type the program name
155
00:06:47,260 --> 00:06:51,053
or the command name, followed by --help.
156
00:06:52,610 --> 00:06:56,140
As you might think, this will show you a help message,
157
00:06:56,140 --> 00:06:57,910
telling you what this command is
158
00:06:57,910 --> 00:06:59,450
or what this program is,
159
00:06:59,450 --> 00:07:01,160
the arguments that it takes,
160
00:07:01,160 --> 00:07:02,742
how to use these arguments
161
00:07:02,742 --> 00:07:05,213
and examples at the bottom.
162
00:07:06,350 --> 00:07:07,590
Now, another useful thing
163
00:07:07,590 --> 00:07:10,100
with the terminal, so I'm gonna clear this again,
164
00:07:10,100 --> 00:07:11,070
is the arrows.
165
00:07:11,070 --> 00:07:14,730
You can press up to go up to see all the commands
166
00:07:14,730 --> 00:07:16,470
that we executed before
167
00:07:16,470 --> 00:07:18,940
and again, you can go down to see to navigate
168
00:07:18,940 --> 00:07:22,573
between the commands that you executed previously.
169
00:07:23,630 --> 00:07:27,230
You can also use the tab for auto complete.
170
00:07:27,230 --> 00:07:28,870
So again, let's do ls
171
00:07:28,870 --> 00:07:30,560
and you can see all the files.
172
00:07:30,560 --> 00:07:34,010
And let's say we want to go into Documents.
173
00:07:34,010 --> 00:07:37,150
So we can do cd followed by Documents.
174
00:07:37,150 --> 00:07:39,080
You can type Documents
175
00:07:39,080 --> 00:07:40,950
or if you're lazy like me,
176
00:07:40,950 --> 00:07:44,448
you can just do Doc and press Tab
177
00:07:44,448 --> 00:07:48,420
and as you can see, it's automatically completing the rest
178
00:07:48,420 --> 00:07:49,633
of the word for me.
179
00:07:50,530 --> 00:07:53,230
So this is something that comes very, very handy
180
00:07:53,230 --> 00:07:55,833
when you're using the terminal for a long time.
181
00:07:56,950 --> 00:07:58,692
Now, what I also wanna show you
182
00:07:58,692 --> 00:08:03,150
is how to install programs in Kali from the terminal.
183
00:08:03,150 --> 00:08:05,290
So first, I'm gonna clear this.
184
00:08:05,290 --> 00:08:06,920
And the first thing that you wanna do
185
00:08:06,920 --> 00:08:09,190
is update the sources where Kali
186
00:08:09,190 --> 00:08:12,163
can search and download programs from.
187
00:08:13,190 --> 00:08:16,683
So we're gonna do apt-get update.
188
00:08:17,750 --> 00:08:20,460
Now, apt-get is the name of the application
189
00:08:20,460 --> 00:08:23,780
that allow us to download and install programs
190
00:08:23,780 --> 00:08:25,310
and we're saying update
191
00:08:25,310 --> 00:08:28,530
because I'm saying that I want you to update the list
192
00:08:28,530 --> 00:08:31,740
of all the programs that I can install.
193
00:08:31,740 --> 00:08:33,430
So I'm gonna hit Enter.
194
00:08:33,430 --> 00:08:35,610
And you wanna make sure that you have internet connection
195
00:08:35,610 --> 00:08:37,440
when running this.
196
00:08:37,440 --> 00:08:40,150
And as you can see, it's telling me that it's done
197
00:08:40,150 --> 00:08:44,506
and now we can go ahead and start installing applications.
198
00:08:44,506 --> 00:08:47,820
So the first program that I wanna install
199
00:08:47,820 --> 00:08:49,880
is actually a terminal program,
200
00:08:49,880 --> 00:08:51,630
so similar to this one,
201
00:08:51,630 --> 00:08:56,080
but it allow us to have multiple terminal windows open
202
00:08:56,080 --> 00:08:57,273
in the same window.
203
00:08:58,190 --> 00:09:00,550
So in order to install a program
204
00:09:00,550 --> 00:09:01,930
through the command line,
205
00:09:01,930 --> 00:09:04,560
we're gonna do apt-get, which is again,
206
00:09:04,560 --> 00:09:05,600
the name of the program
207
00:09:05,600 --> 00:09:09,590
that allow us to install programs on the system.
208
00:09:09,590 --> 00:09:11,950
We're gonna say that I want to install
209
00:09:12,790 --> 00:09:15,040
and the program that I want to install
210
00:09:15,040 --> 00:09:16,753
is called terminator.
211
00:09:18,500 --> 00:09:20,200
So very, very simple.
212
00:09:20,200 --> 00:09:22,290
First of all, we're typing the name of the command,
213
00:09:22,290 --> 00:09:24,100
which is apt-get.
214
00:09:24,100 --> 00:09:26,400
We're saying that I want to install
215
00:09:26,400 --> 00:09:27,420
and the program name
216
00:09:27,420 --> 00:09:30,840
that I wanna install is called terminator.
217
00:09:30,840 --> 00:09:32,123
So I'm gonna hit Enter.
218
00:09:33,680 --> 00:09:38,220
And this is going to download and install terminator for me.
219
00:09:38,220 --> 00:09:40,960
So you can use the same command to install any program
220
00:09:40,960 --> 00:09:41,970
that you want.
221
00:09:41,970 --> 00:09:44,160
You just need to replace terminator
222
00:09:44,160 --> 00:09:45,720
with the name of the program
223
00:09:45,720 --> 00:09:47,173
that you want to install.
224
00:09:48,220 --> 00:09:49,910
Now, I've already downloaded
225
00:09:49,910 --> 00:09:51,290
and installed this before,
226
00:09:51,290 --> 00:09:53,820
so it didn't ask me to confirm.
227
00:09:53,820 --> 00:09:56,210
But if you're running this for the first time,
228
00:09:56,210 --> 00:09:59,730
it might ask you to confirm whether or not you actually want
229
00:09:59,730 --> 00:10:01,320
to install this program.
230
00:10:01,320 --> 00:10:03,160
So all you'd have to do is press Y
231
00:10:03,160 --> 00:10:06,140
from the keyboard and hit Enter.
232
00:10:06,140 --> 00:10:08,170
Now, as you can see, it's done.
233
00:10:08,170 --> 00:10:11,503
So if I go to my all applications in here,
234
00:10:12,860 --> 00:10:14,753
and just type terminator,
235
00:10:15,610 --> 00:10:18,040
you can see that I have it here.
236
00:10:18,040 --> 00:10:19,660
So I'm actually gonna drag it
237
00:10:19,660 --> 00:10:23,860
and put it in my dock so I can access it easily
238
00:10:23,860 --> 00:10:24,833
in the future.
239
00:10:26,670 --> 00:10:29,410
So now I can just click it in here
240
00:10:29,410 --> 00:10:32,420
and that'll open terminator for me.
241
00:10:32,420 --> 00:10:34,220
Now, this is another application
242
00:10:34,220 --> 00:10:36,240
that allow me to run commands.
243
00:10:36,240 --> 00:10:38,910
So it's exactly the same as this.
244
00:10:38,910 --> 00:10:42,430
So again, I can do ls and pwd.
245
00:10:42,430 --> 00:10:44,810
The only difference is with this one,
246
00:10:44,810 --> 00:10:46,780
I can actually right click
247
00:10:46,780 --> 00:10:49,703
and click on Split Horizontally, for example,
248
00:10:50,650 --> 00:10:52,650
and this will split the same screen
249
00:10:52,650 --> 00:10:56,920
into two screens where I can run commands at the same time.
250
00:10:56,920 --> 00:10:59,180
So I can have some commands in here
251
00:10:59,180 --> 00:11:01,323
and I can run commands in here.
252
00:11:01,323 --> 00:11:05,100
And then I can even split this more if I want,
253
00:11:05,100 --> 00:11:08,440
again vertically or horizontally
254
00:11:08,440 --> 00:11:09,730
and as you can see,
255
00:11:09,730 --> 00:11:12,810
I can have as many terminal windows as I want
256
00:11:12,810 --> 00:11:15,130
and this will be very helpful in the future
257
00:11:15,130 --> 00:11:17,630
when we'll be running a number of programs
258
00:11:17,630 --> 00:11:20,203
and a number of commands at the same time.
259
00:11:21,630 --> 00:11:23,030
Now, before I let you go,
260
00:11:23,030 --> 00:11:25,140
I just want to show you two websites
261
00:11:25,140 --> 00:11:27,270
that I'm gonna include in the resources
262
00:11:27,270 --> 00:11:28,810
of this lecture.
263
00:11:28,810 --> 00:11:30,870
First of all, we have a website here
264
00:11:30,870 --> 00:11:33,640
that includes the most common Linux commands,
265
00:11:33,640 --> 00:11:34,750
if not all.
266
00:11:34,750 --> 00:11:37,410
So you can go through them and familiarize yourself
267
00:11:37,410 --> 00:11:39,040
with them, but keep in mind,
268
00:11:39,040 --> 00:11:41,420
you don't need to know them all by heart.
269
00:11:41,420 --> 00:11:44,490
Like I said, as you go through my course
270
00:11:44,490 --> 00:11:46,760
and as you continue on with your journey,
271
00:11:46,760 --> 00:11:49,863
you will learn the commands that you need as you go.
272
00:11:51,130 --> 00:11:52,920
Another really useful resource
273
00:11:52,920 --> 00:11:56,660
that I'm gonna include is explainshell.com.
274
00:11:56,660 --> 00:12:00,400
This website is designed to explain Linux commands to you.
275
00:12:00,400 --> 00:12:02,930
So all you have to do is type the commands in here.
276
00:12:02,930 --> 00:12:06,093
So for example, if you just type ls,
277
00:12:06,950 --> 00:12:08,970
and hit Explain,
278
00:12:08,970 --> 00:12:12,460
it'll explain that ls will list directory content.
279
00:12:12,460 --> 00:12:13,940
You could make it more complex
280
00:12:13,940 --> 00:12:14,943
and do ls -la
281
00:12:16,340 --> 00:12:18,100
and if we hit Enter now,
282
00:12:18,100 --> 00:12:19,810
it'll break all the arguments
283
00:12:19,810 --> 00:12:22,240
and explain every single argument.
284
00:12:22,240 --> 00:12:24,530
So again, ls lists contents.
285
00:12:24,530 --> 00:12:25,970
If we highlight the l,
286
00:12:25,970 --> 00:12:27,510
as you can see, it's telling us
287
00:12:27,510 --> 00:12:30,460
that it's going to use a long listing format
288
00:12:30,460 --> 00:12:31,820
as we've seen earlier
289
00:12:31,820 --> 00:12:35,460
and the a at the end is the same as -a,
290
00:12:35,460 --> 00:12:38,210
which is all, which means that we do not want
291
00:12:38,210 --> 00:12:40,670
to ignore entries starting with a dot,
292
00:12:40,670 --> 00:12:43,033
so we do not want to ignore hidden files.
293
00:12:43,970 --> 00:12:45,780
So you can do any command in here.
294
00:12:45,780 --> 00:12:48,780
You can do apt-get install for example
295
00:12:48,780 --> 00:12:50,810
and I'll actually explain it to you.
296
00:12:50,810 --> 00:12:53,040
So it'll explain apt is a package manager
297
00:12:53,040 --> 00:12:56,265
and install can be used to install packages and so on.
298
00:12:56,265 --> 00:12:58,450
So if you ever see a Linux command
299
00:12:58,450 --> 00:12:59,510
that you don't understand,
300
00:12:59,510 --> 00:13:00,920
you can always just come in here,
301
00:13:00,920 --> 00:13:03,590
put the command and it'll break it down to you
302
00:13:03,590 --> 00:13:05,853
and explain it really nicely.
23490
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.