In Linux, there are a variety of commands to locate files, each with its own set of advantages and disadvantages. Some are only available in certain distributions, and others are not installed by default.
Let’s start with the quickest approach to find files with locate, and then go on to find: a very powerful application that is available in virtually all Linux distributions to help users in finding files.
|locate <what you are looking for>
|Looks through a database, therefore, is really fast
|the database has to be updated in order to find new files
yum install mlocate
Then update the database with the command:
sudo updatedb && locate -e bench-repo
Otherwise you will get an error: locate: can not stat () `/var/lib/mlocate/mlocate.db’: No such file or directory
|find <path> -name “<what you are looking for>”
|No database to use and has lots of advanced features
|Can be slow and requires more typing even for a simple search
Search for exact matches of “whois”
find / -name "whois"
Search for files that have “whois” in their name
find / -name "*whois*"