Continuing reviewing some of my old posts, I found this one Examples of find command, now I want to show you a faster and easier way to find files.

We are going to use the commands updatedb and locate


This command will update the database of the files in a given file system, with no arguments, it will read from / to all file system structure looking for files and archiving the data in the database, located in Debian (/var/cache/locate/locatedb).

There is an option for those using NFS (like me) that you can use to include your NFS file system in the database.

--netpaths=’path1 path2...’

So you can enter a command like this:

sudo updatedb --netpaths=/media/nfs_drive

Now that you have your database updated lets find files.


You just need to enter:

locate filename

and the file named filename will be showed, example:

locate apt-cacher -b

The output is:


With the option -b only shows the files where the final part of the name matches the given file name, otherwise, it will show you the full content of the directory /etc/apt-cacher.