Getting Started with the Basics
11
Performing More Powerful Searches with find
The
find
command is the most powerful and flexible of the searching utili-
ties. It is capable of beginning your search in any designated directory and
looking for a number of different parameters, including, of course, the file-
name but also the date of creation or modification, the owner, the group,
permissions, and the size.
Here’s the basic syntax for
find
:
find
directory options expression
So, if I wanted to search for a file with the name
apache2 (an open source
web server) starting in the root directory, I would enter the following:
kali >
find /
-type f
-name apache2
w
First I state the directory in which to start the search, in this case
/
.
Then I specify which type of file to search for, in this case
f
for an ordi-
nary file
. Last, I give the name of the file I’m searching for, in this case
apache2
w
.
My results for this search are shown here:
kali >