I keep having to do a “man find” (LOL @ man find) to refresh my memory when looking for specific files. Here are some easy to remember tips on find and locate:
find / -type f -name "" would do the trick if you know exact filename.
find / -type f -iname "filename*" if you want to match more files.
-type option if you want to search for directories etc. See manual of find for more information. To see the manual, issue the command:
locate is much more faster than find since it just searches through a database(s) of indexed locations to find your file/regex.
locate some-file.avi searches through a database(s) that is maintained of almost every file on the disk, for a file called “some-file.avi”
locate -i "some-file.avi" will ignore the case of the file you are searching for.
locate -i "*.txt" will display a list of location of all the files with *.txt extension on your system.
man locate for more info on the file..
You might need to run
updatedb first to ensure the index database is up to date, otherwise, ‘locate’ might not return what you are looking for.