
Only filenames containing the string, exclude matches in path name:.Will find any file name containing the word “syslog” There is no wildcard here, so this command: Find all file name containing your search pattern:.Here are three examples of what you can do: You never need sudo with this command, as the database is already created and updated with it. There are a few options, but it’s really simpler than find. The main goal with locate is to quickly find a file based on its name. Once done, you can now use locate directly. I think that this command is automatically done daily on your system, but you can schedule a task if you want to program it as you want. The first thing to do after the installation is to create the database.
FIND ANY FILE INSTALL
Here is the command to install it on Raspberry Pi OS: Now, on recent system versions, it’s not longer included in the system, so you have to start by installing it. The difference with find, is that locate will create a temporary database regularly, to find files quickly (instead of looking for all files with each new request). I remember using it all the time at my beginning on Linux, as I never reminded the find command options. Locate is a command that is easier to use for beginners.
FIND ANY FILE MANUAL
FIND ANY FILE FREE
It’s also useful when you want to free disk space on your SD card. The last option is to look for specific file sizes. It’s very useful when you want to clean your system, or find a file you recently created or modified but don’t remember where.

Ok, so the name/iname option is cool, but what if I don’t know the name of the files I’m looking for? If a file is name “SYSlog” somewhere, it will find it with iname, not with name. It will display the results, for insensitive case match. The first one is for file ending with “syslog”, the second starting with “syslog” and the last one containing “syslog”.Īnd a last alternative for a basic search, is to use the “-iname” option rather than “-name”. If you also want files containing the word you provide in parameter, you can use stars as wildcard, for example: This is perfect if you know the exact name of a file and want to locate it, but it’s not working if you only have a part of the name. You can remove the path to search in the current directory (recursively), or the options (to display all file), but most of the time you will use both.Īlso, when looking for a file in the whole file system, don’t forget to use sudo to get access to the system files. The find syntax is generally formatted as: I will try to keep this simple, and give you the most useful options only. Unfortunately, many criteria means many options to remember when you try to use it.

It’s powerful and will save you most of the time, as you can add many criteria to filter the results you are interested in.
FIND ANY FILE PDF
Grab your free PDF file with all the commands you need to know on Raspberry Pi!įind is the command that most people will give you when you ask where is my file.
