find /var/www/wordpress/ -type f -name wp-config.php That's because it is relatively simple as you only need to pass the name of the file you are searching for. That is probably the most utilized method by users to lookup files on Linux. Let's now look at more practical examples of the find command. -name "*.js": This is an expression to find all files that end with the./etc/apache2/sites-available: This is the location where we want to look up the file.-L: This parameter tells the find command to follow symbolic links.find -L /etc/apache2/sites-available -name "*.js" Let's write a simple find command that utilizes the syntax above. : Here, you specify the file name you are looking for.]expression]: This is where you add your options, actions, and search patterns.: This parameter defines the location of the directory where you want to look up your file.: This parameter is used to handle symbolic links, optimizations, and debugging options.find: Here, we are simply calling the find command.After making some comparisons, we found the general syntax should be as follows. When you do a simple lookup online or run the man find command on the Terminal, you will realize that different people use different syntaxes of the find command depending on the scenario. You can also use it with other commands like grep and sed to get a more filtered output. The find command allows you to search/ lookup files and directories by name, size, ownership, type, date modified, and much more.
This command uses a simple syntax to filter files recursively and can be used with the exec command to retrieve and process a file right away. A solution for that is to use the find command-line utility. Unfortunately, this method might not be quite efficient for finding files inside multiple folders or even on a headless system such as a remote server. If you are on a Graphical system, you can quickly type the file name on the search bar to retrieve it. When working with Linux systems, you will often find yourself in a situation where you need to look/find particular files on your system.