Customize Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorized as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.

No cookies to display.

Recommended Services
Supported Scripts

Find is a very useful utility available in all the Linux server across all the variants, in this post let’s discuss some of the use cases of the command “find“.

You are in a directory with thousands of files and you want to specifically search for “.png” and “.php” files.

You can achieve this by running the following command on the bash and in the directpoy where you want to initiate a search.

find . -type f \( -name "*.png" -o -name "*.php" \)

Below would be the expected output

[root@localhost ]# find . -type f \( -name "*.png" -o -name "*.php" \)
./includes/mail.php
./includes/pipe.php
./includes/upgrade.php
./includes/controller.php
./includes/contact-form-template.php
./includes/js/jquery-ui/themes/smoothness/images/ui-bg_glass_75_dadada_1x400.png
./includes/js/jquery-ui/themes/smoothness/images/ui-icons_222222_256x240.png
./includes/js/jquery-ui/themes/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png
./includes/js/jquery-ui/themes/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
./includes/js/jquery-ui/themes/smoothness/images/ui-bg_flat_75_ffffff_40x100.png
./includes/js/jquery-ui/themes/smoothness/images/ui-icons_2e83ff_256x240.png
./includes/js/jquery-ui/themes/smoothness/images/ui-icons_888888_256x240.png

Now, let say you want to search for two specific files in a directory. You know the names of the files that you want to search, in that you can use the below command syntax to find those files that you are looking for.

File names that I want to search is “functions.php” and “config.php

[root@localhost public_html]# find -name "config.php" -o -name "functions.php"

Below would be the expected output

[root@localhost public_html]# find -name "config.php" -o -name "functions.php"
./plugins/akismet/views/config.php
./plugins/contact-form-7/includes/functions.php
./plugins/all-404-redirect-to-homepage/functions.php
./plugins/wordpress-seo/vendor/yoast/api-libs/google/config.php
./themes/frontier/functions.php
./functions.php