Install the package locate to get the eponymous command

The first way to search for a file in all a filesystem is to use the command locate
With Debian, locate is no more included in the package findutils.
You must install the package locate which provides the commands locate and updatedb.
As root :
root@localhost:~#apt-get install locate

Then, issue the following command to check whether the commands locate and updatedb are available :

root@localhost:~#which locate
root@localhost:~#which updatedb

The command locate looks through an index for searching a file.
This index is built after issuing the command  updatedb as root :

root@localhost:~#updatedb

The more recent the index is, the more efficient is the search through locate.
Make sure that the index is rebuilt on a regular basis. This point is all the more crucial since there are a lot of files creation/deletion. The index could be outdated very quickly.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s