WEBVTT

00:00.750 --> 00:02.122
All right. Hello and welcome

00:02.580 --> 00:04.469
to Command Line Survival, part one

00:04.470 --> 00:06.419
for the command line basics course

00:06.420 --> 00:07.420
here on SIBERRY.

00:07.630 --> 00:09.659
So this module

00:09.660 --> 00:11.489
will take you into a bunch of

00:11.490 --> 00:13.139
different tips and techniques that

00:13.140 --> 00:14.806
you can use to really work through

00:14.820 --> 00:16.045
the command line and save

00:16.890 --> 00:19.079
time and hopefully

00:19.080 --> 00:20.969
help get you much more comfortable

00:20.970 --> 00:21.970
with the command line.

00:22.590 --> 00:24.269
So in this module, we've going to

00:24.270 --> 00:25.859
learn autocomplete techniques,

00:26.280 --> 00:27.897
learn how the Iraqis are utilized

00:28.350 --> 00:29.869
at the same time and understand

00:30.210 --> 00:31.440
how did you come in history.

00:31.850 --> 00:33.060
These are all very important

00:33.210 --> 00:34.709
concepts that you need to understand

00:34.710 --> 00:35.759
while you're working at the command

00:35.760 --> 00:36.760
line.

00:38.100 --> 00:39.668
Right assessment, so what is the

00:39.750 --> 00:41.269
best way to cement a previously

00:42.060 --> 00:43.060
entered command?

00:43.290 --> 00:44.909
Is it going to be a pressing the

00:44.910 --> 00:46.499
control key and H.

00:46.980 --> 00:48.254
B, open the Basche history

00:49.020 --> 00:51.360
file and copy paste, C,

00:51.540 --> 00:53.759
use the up arrow key or D,

00:53.850 --> 00:56.000
press the control key and Z,

00:56.670 --> 00:58.238
we want to resubmit a previously

00:59.040 --> 01:00.040
entered command.

01:01.330 --> 01:03.240
If you said see the up arrow key,

01:03.360 --> 01:04.318
you're correct.

01:04.319 --> 01:05.789
It helps cycle through previously

01:05.790 --> 01:07.162
entered commands and is very

01:07.680 --> 01:08.729
quick and easy to use.

01:09.330 --> 01:11.249
Pressing the control keying H does

01:11.250 --> 01:13.049
not really do anything.

01:13.230 --> 01:14.357
The command line and it

01:15.150 --> 01:16.499
is true you can open the Basche

01:16.500 --> 01:18.389
history file and copy and paste

01:18.390 --> 01:19.566
it into the command line

01:20.370 --> 01:21.546
window, but that's a lot

01:22.410 --> 01:24.089
of extra steps and it's not very

01:24.090 --> 01:25.090
easy.

01:25.740 --> 01:27.989
And then pressing the control key

01:27.990 --> 01:29.869
and Z actually ends

01:29.880 --> 01:31.546
any running process at the command

01:31.680 --> 01:33.346
line terminal, which will learn in

01:33.540 --> 01:34.540
the our command line

01:35.400 --> 01:36.829
survival part one.

01:38.190 --> 01:38.969
All right.

01:38.970 --> 01:40.319
So typing commands

01:41.340 --> 01:42.908
in order to type of command, you

01:43.200 --> 01:44.880
need to be able to

01:45.180 --> 01:47.159
identify what you're trying

01:47.160 --> 01:48.160
to accomplish.

01:48.480 --> 01:49.852
It's it's very easy to start

01:50.550 --> 01:52.920
typing commands without

01:53.100 --> 01:55.049
knowing exactly what you want

01:55.050 --> 01:55.889
to do.

01:55.890 --> 01:57.719
So if you can understand what

01:57.720 --> 01:59.484
you're trying to do from the command

01:59.970 --> 02:01.700
line, then that

02:01.860 --> 02:03.119
will help you choose which command

02:03.120 --> 02:04.394
to use which which is what

02:04.620 --> 02:06.239
parameters and how to really attack

02:06.240 --> 02:07.240
your problem.

02:07.350 --> 02:08.918
So like I was saying before, the

02:09.270 --> 02:11.159
command kind

02:11.160 --> 02:13.559
of syntax is you need the command,

02:13.830 --> 02:15.610
a switch and then a parameter.

02:16.200 --> 02:17.429
So in this example,

02:18.180 --> 02:19.950
we are going to search for

02:20.160 --> 02:21.287
a weakness, grep search

02:21.990 --> 02:22.990
for Frankenstein and

02:23.970 --> 02:26.069
we're using the tech or the dash

02:26.430 --> 02:27.239
switch.

02:27.240 --> 02:28.949
And if you look it up in the manual,

02:29.220 --> 02:31.110
the dash I switch,

02:31.440 --> 02:34.069
it stands for case insensitive.

02:34.620 --> 02:36.139
So if we look for Frankenstein,

02:36.810 --> 02:38.427
it doesn't have to be capitalized

02:38.490 --> 02:39.490
and it'll grab

02:40.590 --> 02:42.119
matches for anything that is not

02:42.120 --> 02:43.120
capitalized.

02:43.740 --> 02:44.740
And

02:45.870 --> 02:47.536
you can always press the energy to

02:47.550 --> 02:48.550
enter your command.

02:48.630 --> 02:49.630
Pretty straightforward.

02:51.240 --> 02:52.679
All right. Some very important

02:52.680 --> 02:54.449
commands that you need to understand

02:54.450 --> 02:56.099
while you're working at the command

02:56.100 --> 02:58.000
line. We have probed

02:58.230 --> 02:59.939
stands for Working Directory.

03:00.270 --> 03:01.859
It shows the current directory you

03:01.860 --> 03:03.960
are in while you are in class.

03:04.320 --> 03:05.219
This is very useful.

03:05.220 --> 03:07.349
So you know what is where

03:07.350 --> 03:09.259
you're at in the file system.

03:09.870 --> 03:11.009
Now, if you want to know what's

03:11.010 --> 03:12.789
inside of the directory you're in,

03:13.010 --> 03:15.059
you're going to use the command

03:15.060 --> 03:17.159
for windows or the endless command

03:17.160 --> 03:18.970
for Linux and Dursban

03:19.050 --> 03:19.919
for directory.

03:19.920 --> 03:21.779
And Ellis stands for listing

03:22.290 --> 03:23.564
and it lists everything in

03:24.120 --> 03:25.979
your present working directory,

03:25.980 --> 03:27.450
that working directory command

03:27.990 --> 03:28.990
that you just used.

03:29.040 --> 03:30.657
And it will show all the files in

03:30.660 --> 03:31.559
there.

03:31.560 --> 03:32.879
And then if you want to be able to

03:32.880 --> 03:34.589
move to a different directory,

03:34.890 --> 03:36.839
you're going to use the CD Command,

03:36.900 --> 03:38.789
which is change directory, and

03:38.790 --> 03:39.839
that will help you move to different

03:39.840 --> 03:41.370
folders so you can look through

03:41.550 --> 03:43.500
Uster or else from there

03:43.710 --> 03:45.030
and be able to see what's in there.

03:45.850 --> 03:47.699
So let me give you a quick example.

03:48.240 --> 03:49.240
So for here, this

03:50.220 --> 03:51.220
is for Windows.

03:51.300 --> 03:53.279
If I cheat,

03:53.490 --> 03:55.107
we are going to do different work

03:55.440 --> 03:56.440
directory.

03:57.970 --> 03:58.970
Excuse me.

03:59.490 --> 04:00.959
So this will change

04:02.430 --> 04:03.740
everything in our directory here.

04:03.750 --> 04:05.669
This is for my personal folder.

04:06.360 --> 04:08.339
And then if we want to change

04:08.340 --> 04:09.800
directory, CD

04:10.320 --> 04:12.180
and desktop,

04:12.480 --> 04:14.099
because we can see that there is a

04:14.100 --> 04:15.240
desktop folder here.

04:16.829 --> 04:18.389
All right. And now we're inside the

04:18.390 --> 04:19.390
desktop folder.

04:19.410 --> 04:20.759
If we want to see what's inside of

04:20.760 --> 04:22.469
there, type DYA

04:23.220 --> 04:24.179
and enter.

04:24.180 --> 04:25.769
And this is what we have inside my

04:25.770 --> 04:26.770
desktop folder.

04:27.180 --> 04:28.199
This is for Windows.

04:29.250 --> 04:30.769
All right. So for Linux, we are

04:31.080 --> 04:32.189
going to type DVD

04:33.930 --> 04:35.069
and this will print a working

04:35.070 --> 04:36.819
directory which is flash home slash

04:36.930 --> 04:37.769
user.

04:37.770 --> 04:39.191
And you can also tell because

04:39.630 --> 04:41.100
before the command line symbol

04:41.490 --> 04:43.649
we have the tilde, which,

04:43.650 --> 04:45.239
as you know, when Linux is for the

04:45.240 --> 04:47.309
home folder and

04:47.310 --> 04:48.659
now if we want to see what's inside

04:48.660 --> 04:49.950
of this folder, I'm going to type

04:50.370 --> 04:52.649
for list and it shows everything

04:52.650 --> 04:53.770
inside of this folder.

04:54.420 --> 04:55.988
Now, what I highly recommend for

04:56.070 --> 04:57.785
doing as a security professional is

04:58.050 --> 05:00.290
to do Ellos Tech LTA

05:00.900 --> 05:02.321
and that will list everything

05:03.120 --> 05:04.470
and show you

05:05.100 --> 05:06.178
all of the permissions

05:07.470 --> 05:08.470
for the files.

05:08.820 --> 05:11.009
And it will also give any

05:11.010 --> 05:12.010
hidden files.

05:12.120 --> 05:13.529
So as you'll see right now,

05:14.580 --> 05:16.200
this was the first listing we got

05:16.380 --> 05:18.209
and it showed all of these folders

05:18.210 --> 05:19.199
that I have.

05:19.200 --> 05:21.029
But these files,

05:21.120 --> 05:23.369
they don't, as you know, are hidden

05:23.370 --> 05:25.350
files and Linux and

05:25.560 --> 05:27.869
using the A switch

05:28.140 --> 05:29.610
and lets us see all the files,

05:29.880 --> 05:31.079
including the hidden files.

05:31.380 --> 05:32.940
So this batch history file,

05:33.360 --> 05:34.879
it is not in this first listing

05:35.100 --> 05:36.540
because it is a hidden file.

05:38.070 --> 05:39.070
All right.

05:39.760 --> 05:40.760
So let's move on.

05:41.590 --> 05:43.540
So autocomplete techniques,

05:43.930 --> 05:45.959
we use the tab key tab

05:45.970 --> 05:47.199
completion is your friend.

05:47.210 --> 05:48.940
It will save you so much time.

05:49.450 --> 05:51.489
So it will only complete within

05:51.760 --> 05:53.229
the present working directory that

05:53.230 --> 05:54.199
you're in.

05:54.200 --> 05:56.439
And if there are more than one match

05:56.590 --> 05:58.449
for something you're typing

05:58.450 --> 06:00.339
out, you can press tab twice and it

06:00.340 --> 06:01.730
will list all the matches.

06:02.230 --> 06:04.060
So let me show you here

06:04.510 --> 06:06.129
that say dot

06:07.390 --> 06:08.390
less

06:10.150 --> 06:11.228
dot B, because we have

06:11.980 --> 06:14.079
a bunch of files, three

06:14.080 --> 06:16.149
files here that have the be there

06:16.690 --> 06:18.579
and they all start

06:18.580 --> 06:19.580
with Besch.

06:20.590 --> 06:21.913
So I push the tab there and

06:22.630 --> 06:24.699
if I push tab twice, it will show us

06:24.700 --> 06:26.023
all of the files that match

06:26.560 --> 06:27.459
that.

06:27.460 --> 06:29.199
But let's say I want it to change

06:29.890 --> 06:31.839
or go

06:31.840 --> 06:33.212
through the pseudo add admin

06:33.610 --> 06:34.690
successful file.

06:35.920 --> 06:37.180
That's a lot to type, right?

06:37.420 --> 06:39.880
So we type Suto

06:39.910 --> 06:40.910
sound right here and

06:41.920 --> 06:44.089
then tab and it will auto completed.

06:44.140 --> 06:45.708
Also I don't have to type it and

06:45.760 --> 06:47.679
that's great because it saves

06:47.680 --> 06:49.089
my time. Saves your time.

06:49.750 --> 06:50.750
We all do. Great.

06:51.010 --> 06:51.819
All right.

06:51.820 --> 06:53.130
Aoki's at the Seelie.

06:53.500 --> 06:54.921
We get the up and down key up

06:55.420 --> 06:56.859
scrolls through previous commands

06:57.130 --> 06:59.079
and down scrolls back from

06:59.080 --> 07:00.970
the key super useful.

07:01.120 --> 07:02.589
It will save you a lot of time

07:02.590 --> 07:03.399
because you were going to be

07:03.400 --> 07:04.929
constantly repeating commands.

07:05.410 --> 07:06.879
So let me show you that real quick

07:07.660 --> 07:08.660
so

07:09.550 --> 07:11.170
you could see a push up here.

07:11.290 --> 07:13.209
And we got back our previous command

07:13.630 --> 07:15.309
push the up key again, our

07:15.880 --> 07:16.659
delay.

07:16.660 --> 07:18.300
Ellis pretty.

07:18.660 --> 07:20.889
If I go back down the down

07:20.890 --> 07:22.929
arrow, it bring us back down

07:22.930 --> 07:23.930
through those commands.

07:24.370 --> 07:25.659
That will save you a lot of time

07:25.660 --> 07:26.529
because you're going to be

07:26.530 --> 07:28.870
constantly resubmitting different

07:29.230 --> 07:30.847
commands that you were doing as a

07:31.090 --> 07:32.090
secured.

07:33.550 --> 07:35.040
All right. Command history for

07:35.050 --> 07:36.050
Windows.

07:36.160 --> 07:37.059
Pretty straightforward.

07:37.060 --> 07:38.677
We have the seven key and you can

07:38.860 --> 07:41.230
also type dashikis flash history.

07:41.440 --> 07:43.239
Now, it is important to note

07:43.570 --> 07:45.339
that there is no persistent command

07:45.340 --> 07:47.230
history in windows by default.

07:47.530 --> 07:49.059
And if you want to save

07:49.360 --> 07:51.459
your command history in Windows,

07:51.730 --> 07:53.680
then I'd recommend

07:53.890 --> 07:56.109
typing the slash history command

07:56.530 --> 07:57.939
and then just copying pasting

07:57.940 --> 07:59.655
everything right out of the command

07:59.920 --> 08:01.180
window into a text file.

08:01.750 --> 08:03.579
Other than that, there is no really

08:03.580 --> 08:05.679
kind of persistent command history

08:05.680 --> 08:07.029
like there is for Linux.

08:08.590 --> 08:10.029
So like I was saying for Linux,

08:10.630 --> 08:12.519
there is the best history

08:12.520 --> 08:14.589
file in a home folder

08:14.830 --> 08:16.600
and that records a user's

08:17.500 --> 08:19.509
history in the back in

08:19.510 --> 08:20.510
the shell.

08:21.310 --> 08:22.339
So if you as I showed

08:23.230 --> 08:24.749
up here in the top right, if we

08:25.120 --> 08:26.889
do cat bash history

08:27.580 --> 08:28.829
and you will learn that the cat

08:28.840 --> 08:30.759
command is for CONCATENATE

08:30.760 --> 08:32.619
and it spits out anything in a

08:32.620 --> 08:34.689
file, and it'll show us that

08:35.350 --> 08:37.179
all the previous commands that I did

08:37.960 --> 08:39.999
for this user account.

08:40.510 --> 08:41.889
And then there's also the history

08:41.890 --> 08:43.690
covid where we can type.

08:44.260 --> 08:45.519
We will show all the previous

08:45.520 --> 08:46.750
commands that we typed as well.

08:48.570 --> 08:49.799
All right, post the segment,

08:50.430 --> 08:51.719
which command tells you what

08:51.720 --> 08:52.720
director you're in.

08:52.740 --> 08:53.740
Is it A pretty B

08:54.690 --> 08:56.369
folder, C cat

08:56.730 --> 08:57.730
or D Echo?

08:57.990 --> 08:59.579
And we want to know which folder we

08:59.580 --> 09:00.580
are in.

09:01.260 --> 09:03.119
And if you said a DVD for

09:03.390 --> 09:05.070
working directory, you're correct.

09:06.060 --> 09:08.099
The folder command is a real

09:08.100 --> 09:09.100
command.

09:09.630 --> 09:11.729
The cat command is used

09:11.730 --> 09:13.619
to spit out the contents

09:13.620 --> 09:15.240
of a file for concatenate.

09:15.540 --> 09:16.949
And it's not for telling you what

09:16.950 --> 09:17.950
directory you're in.

09:18.300 --> 09:20.190
And the Echo Command is

09:20.280 --> 09:22.499
used to send

09:22.500 --> 09:24.389
text back out of the

09:24.870 --> 09:26.279
command line interface that you'll

09:26.280 --> 09:27.749
learn. But it's not to tell you

09:27.750 --> 09:28.529
which directory.

09:28.530 --> 09:29.530
Right?

09:30.120 --> 09:31.169
All right. So in this video, we

09:31.170 --> 09:32.789
learned autocomplete techniques,

09:32.940 --> 09:34.499
learned how to use the Iraqis that

09:34.500 --> 09:36.419
are utilized at the Seelie and

09:36.420 --> 09:37.679
understand how to view command

09:37.680 --> 09:39.297
history. And I hope to see you in

09:39.390 --> 09:40.049
the next video.

