From time to time you will need to search for a file or a script or a programming calendar next.
How can we do that.
There is three different ways for searching Linux and definitely you need to be aware of them before
starting the penetration testing process.
So the first way is a graphical way the easy way.
You click on the file manager you go there and you search.
So I assume that I'm looking for a file called password and the password file is written this way.
B E S S W2.
So when I searched in the file manager he didn't get me anything because he only search in the specific
folder where you are looking.
Now I am inside my home folder so he all only got a session site home folder.
While I know that the passport files are in each DC folder so I can specify or I have to actually I
have to specify the search location first so if I go and click on other location and click computer
that's mean he gonna searching all source folder right.
And I go one more time search and I search for the file.
Password.
And he gonna get me all the file name the password from different location could be a folder it could
be a file and this is similar to Windows actual I mean in Windows.
If you open the explorer from here and you search.
So assuming that I'm searching in my desktop and I type any file name he will search only on desktop.
Well if I click on this P.C. for instance.
If I click on any other location like this P.C. and I type a file name he can assertion all the drive.
Also this can also location.
So is the exact same concept in searching that you have to specify the location.
Then there is two different tool to different comment that also will help you to search the best one
is called locate so locate and you type any find him and he will search in all the directory and it
doesn't matter where you are located on in which folder you are located.
He will search everywhere but before using locate you need to type this comment up date D.B. and this
government actually I'm sorry.
The
this comment will build the database for file and directory.
So before using locate just the two types it's common and you do that only one time.
It's not like every time you are using locate you have to build the database for a file and directory
local file and directory.
No it's done one time.
Once you start using calendar Nixon's that's it.
Now let's see if I type look it and before typing look it I can type this comment P W G which means
print working directory.
I mean where I am located right now.
So the cursor or the the the I am located inside the root and that is the main root inside the root
folder.
So if I type here locate and the same file name which is password it's not like you will only search
inside this root folder he will search everywhere.
So he search inside through these search inside the user share a search inside the variable.
He search everywhere including the ATC and he gave me all the file under the same name could be the
VANOC password.
It could be just password file it could be.
So he searched everywhere.
So look it is a good advantage of using Luke that he's searching everywhere.
The search as you can see the search common or the second comment and the third way is that I wanted
to show you for searching is called Find.
So let me clear my screen and let me use the finding find it's a little bit aggressive.
I mean you have to specify the location you have to specify to find him.
So if I type find.
Okay.
And then click on enter he will search for everything while if I recreate the screen one more time if
I type find and then I put the location mean inside the road inside the ATC then minus name.
So I'm searching by find him and I type the file name pass Ward he will search only in the ATC folder
so he is output will be that I find three different file password and password and password one is inside
this folder a sub folder and one is inside the ATC the main folder and so on.
So the advantage of finds that you can specify exactly what you are looking for and where and I can
use this white card characters icons for instance search for any files that start with B and I put the
star star I mean everything that starts with p letter and he will search for anything actually I think
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
s so you can use a sign as all so find will give you option to specify what you are looking for locate
are searching everywhere and you have significantly use whatever you are suitable whatever is suitable
for you whatever you feel comfortable using it but you can see later on that we're going to need to
use those searching comment from time to time.