Читать книгу Kali Linux Penetration Testing Bible - Gus Khawaja - Страница 30
Searching for Files
ОглавлениеThere are multiple ways to search for files in Kali; the three common ones are the locate
, find
, and which
commands.
You can use the locate
command to locate a file that you're looking for quickly. You need to know that the locate
command stores its data in a database, so when you search, you will find your results faster.
First, you will need to update the database for the locate
command using the updatedb
command:
$updatedb
Now, we can start searching using the locate
command:
$locate [file name] root@kali:/# locate test.sh /home/kali/test.sh /usr/share/doc/socat/examples/readline-test.sh /usr/share/doc/socat/examples/test.sh
You can use the ‐n
switch for the locate
command to filter out the number of output results. This option is handy if you know that the results will be enormous:
$locate -n [i] [search file criteria] root@kali:/# locate *.conf -n 3 /etc/adduser.conf /etc/ca-certificates.conf /etc/debconf.conf