12
Chapter 1
file
apache2 has an extension, such as
apache2.conf,
the search will not find a
match. We can remedy this limitation by using
wildcards, which enable us to
match multiple characters. Wildcards come in a few different forms:
*
.
,
?
and
[]
.
Let’s look in the
/etc directory for all files that begin with
apache2 and
have any extension. For this,
we could write a
find
command using the fol-
lowing wildcard:
kali >
find /etc -type f -name apache2.\*
/etc/apache2/apache2.conf
When we run this command, we find that there is one file in the
/etc
directory that fits the
apache2.*
pattern. When we use a period followed
by the
*
wildcard, the terminal looks for any extension
after the filename
apache2. This can be a very useful technique for finding files where you
don’t know the file extension.
When I run this command, I find two files that start with
apache2 in the
/etc directory, including the
apache2.conf file.