Skip to main content
IBM 
ShopSupportDownloads
IBM HomeProductsConsultingIndustriesNewsAbout IBM
IBM : developerWorks : Linux : Education - Tutorials
LPI certification 101 exam prep, Part 2
ZIPPDF (letter)PDF (A4)e-mail
Main menuSection menuFeedbackPreviousNext
3. FHS and finding files
  


locate page 19 of 21


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

Main menuSection menuFeedbackPreviousNext
PrivacyLegalContact