We have covered which
, whereis
, and
find
. You might have noticed that find
can take a
while to execute, due to the fact that it needs to read each directory that
it's searching. It turns out that the locate
command can speed
things up by relying on an external database.
The locate
command matches against any part of a pathname, not
just the file itself. For example:
$ locate bin/ls
/var/ftp/bin/ls
/bin/ls
/sbin/lsmod
/sbin/lspci
/usr/bin/lsattr
/usr/bin/lspgpot
/usr/sbin/lsof