Using locate to search for files from the terminal

Need to locate a specific file somewhere on your system? Luckily, there is an appropriated named search tool which you can use to do that. It’s called locate and it’s very similar to file search in Windows file manager.

Not all Linux installs come with locate, so you may need to install it.

yum install locate

Also, the first time you run it, it will need to build the database, so that will take a little longer. But once it is up and running, it is pretty fast. Simply use the command followed by a file name, or even just part of a file name, to get a list of all the files on your system that match.

locate httpd.conf
Timeline

Newsletter

Don't have time to check my blog? Get a weekly email with all the new posts. This is my personal blog, so obviously it is 100% spam free.

Metadata

Tags: , , , ,

This entry was posted on Sunday, April 15th, 2012 at 11:44 am and is filed under Life, Tech. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.