WEBVTT

00:05.110 --> 00:10.840
From time to time you will need to search for a file or a script or a programming calendar next.

00:10.840 --> 00:12.890
How can we do that.

00:12.910 --> 00:19.450
There is three different ways for searching Linux and definitely you need to be aware of them before

00:19.960 --> 00:22.990
starting the penetration testing process.

00:23.020 --> 00:26.020
So the first way is a graphical way the easy way.

00:26.020 --> 00:30.580
You click on the file manager you go there and you search.

00:30.610 --> 00:38.050
So I assume that I'm looking for a file called password and the password file is written this way.

00:38.050 --> 00:40.040
B E S S W2.

00:41.050 --> 00:52.300
So when I searched in the file manager he didn't get me anything because he only search in the specific

00:52.300 --> 00:54.010
folder where you are looking.

00:54.070 --> 00:59.440
Now I am inside my home folder so he all only got a session site home folder.

00:59.950 --> 01:08.440
While I know that the passport files are in each DC folder so I can specify or I have to actually I

01:08.440 --> 01:15.190
have to specify the search location first so if I go and click on other location and click computer

01:15.800 --> 01:19.900
that's mean he gonna searching all source folder right.

01:20.710 --> 01:26.110
And I go one more time search and I search for the file.

01:30.500 --> 01:31.350
Password.

01:31.510 --> 01:38.170
And he gonna get me all the file name the password from different location could be a folder it could

01:38.170 --> 01:43.370
be a file and this is similar to Windows actual I mean in Windows.

01:43.390 --> 01:50.310
If you open the explorer from here and you search.

01:50.320 --> 01:57.050
So assuming that I'm searching in my desktop and I type any file name he will search only on desktop.

01:57.430 --> 02:01.420
Well if I click on this P.C. for instance.

02:02.680 --> 02:12.300
If I click on any other location like this P.C. and I type a file name he can assertion all the drive.

02:12.300 --> 02:14.090
Also this can also location.

02:14.110 --> 02:18.670
So is the exact same concept in searching that you have to specify the location.

02:21.570 --> 02:28.980
Then there is two different tool to different comment that also will help you to search the best one

02:29.040 --> 02:38.370
is called locate so locate and you type any find him and he will search in all the directory and it

02:38.370 --> 02:43.260
doesn't matter where you are located on in which folder you are located.

02:43.260 --> 02:54.690
He will search everywhere but before using locate you need to type this comment up date D.B. and this

02:54.690 --> 02:57.360
government actually I'm sorry.

02:59.130 --> 02:59.470
The

03:03.920 --> 03:07.970
this comment will build the database for file and directory.

03:07.970 --> 03:12.650
So before using locate just the two types it's common and you do that only one time.

03:12.680 --> 03:18.890
It's not like every time you are using locate you have to build the database for a file and directory

03:18.920 --> 03:20.540
local file and directory.

03:20.530 --> 03:22.430
No it's done one time.

03:22.430 --> 03:24.290
Once you start using calendar Nixon's that's it.

03:24.770 --> 03:33.620
Now let's see if I type look it and before typing look it I can type this comment P W G which means

03:33.650 --> 03:35.630
print working directory.

03:35.630 --> 03:38.080
I mean where I am located right now.

03:38.210 --> 03:46.070
So the cursor or the the the I am located inside the root and that is the main root inside the root

03:46.070 --> 03:46.480
folder.

03:47.030 --> 03:58.310
So if I type here locate and the same file name which is password it's not like you will only search

03:58.340 --> 04:01.020
inside this root folder he will search everywhere.

04:01.040 --> 04:07.110
So he search inside through these search inside the user share a search inside the variable.

04:07.460 --> 04:15.740
He search everywhere including the ATC and he gave me all the file under the same name could be the

04:15.900 --> 04:16.910
VANOC password.

04:16.940 --> 04:19.330
It could be just password file it could be.

04:19.460 --> 04:21.230
So he searched everywhere.

04:21.710 --> 04:26.730
So look it is a good advantage of using Luke that he's searching everywhere.

04:27.300 --> 04:37.070
The search as you can see the search common or the second comment and the third way is that I wanted

04:37.070 --> 04:39.320
to show you for searching is called Find.

04:40.010 --> 04:46.430
So let me clear my screen and let me use the finding find it's a little bit aggressive.

04:46.430 --> 04:50.080
I mean you have to specify the location you have to specify to find him.

04:50.180 --> 04:51.440
So if I type find.

04:52.520 --> 04:53.040
Okay.

04:53.050 --> 05:01.850
And then click on enter he will search for everything while if I recreate the screen one more time if

05:01.850 --> 05:12.650
I type find and then I put the location mean inside the road inside the ATC then minus name.

05:12.650 --> 05:22.620
So I'm searching by find him and I type the file name pass Ward he will search only in the ATC folder

05:22.650 --> 05:30.300
so he is output will be that I find three different file password and password and password one is inside

05:30.300 --> 05:35.520
this folder a sub folder and one is inside the ATC the main folder and so on.

05:36.300 --> 05:43.380
So the advantage of finds that you can specify exactly what you are looking for and where and I can

05:43.380 --> 05:52.440
use this white card characters icons for instance search for any files that start with B and I put the

05:52.440 --> 06:00.300
star star I mean everything that starts with p letter and he will search for anything actually I think

06:00.300 --> 06:11.400
we need to type like p e s so I'm telling him I need to search for all the files that start whose p

06:11.400 --> 06:20.340
s so you can use a sign as all so find will give you option to specify what you are looking for locate

06:20.370 --> 06:27.360
are searching everywhere and you have significantly use whatever you are suitable whatever is suitable

06:27.360 --> 06:32.460
for you whatever you feel comfortable using it but you can see later on that we're going to need to

06:32.460 --> 06:35.030
use those searching comment from time to time.
