35 Practical Examples of Linux Find Command

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Use our Hosting referral link if you planning to start your blog ($3.82/month).
  4. Support us via PayPal donate - Make a Donation
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Ravi Saive

I am Ravi Saive, creator of TecMint. A Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux. Follow Me: Twitter, Facebook and Google+

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

115 Responses

  1. raju says:

    Hi all, i want to find particular word in all in my Unix box.

    Please send me command…

    • Ravi Saive says:

      @Raju,

      You can use egrep with options to find the particular string in all files as shown:

      # egrep -w 'stringname' filepath
      
      
      
      
  2. Bhavik Bhansali says:

    Thanks tecmint for such a wonderful series of tutorial on Linux. it helps a lot to me as I am new to Linux.

    • Ravi Saive says:

      @Bhavik,

      Thanks a lot for finding our articles useful, and also good to hear that our articles helping you to learn Linux in an easy way..

      • Bhavik Bhansali says:

        Wonderful part of your blog is the way you chose to explain each part that impresses me. Thank you for this blog. :-)

  3. Prabhakar Kumar says:

    Dear Ravi, I appreciate your work. This blog is very easy to read and understand. Please keep it up. All the best.

  4. ramachandra says:

    guys,

    I m not able to login in to any of the user and getting the authentication failure, please help me on this

    Error in the logs

    [root@india etc]# grep rama2 /var/log/secure
    Jan 21 04:34:07 india useradd[4117]: new group: name=rama2, GID=504
    Jan 21 04:34:07 india useradd[4117]: new user: name=rama2, UID=504, GID=504, 
    home=/home/rama2, shell=/bin/bash
    Jan 21 04:34:16 india passwd: pam_unix(passwd:chauthtok): password changed for rama2
    Jan 21 04:34:20 india su: pam_unix(su:session): session opened for user rama2 by root(uid=0)
    Jan 21 04:35:16 india su: pam_unix(su:session): session closed for user rama2
    Jan 21 04:36:35 india su: pam_unix(su:session): session opened for user rama2 by root(uid=0)
    Jan 21 04:36:42 india su: pam_unix(su:session): session closed for user rama2
    Jan 21 04:42:19 india unix_chkpwd[4195]: password check failed for user (rama2)
    Jan 21 04:42:19 india pam: gdm-password[3902]: pam_unix(gdm-password:auth): 
    authentication failure; logname= uid=0 euid=0 tty=:1 ruser= rhost=  user=rama2
    Jan 21 04:48:33 india unix_chkpwd[2792]: password check failed for user (rama2)
    Jan 21 04:48:33 india login: pam_unix(login:auth): authentication failure; 
    logname=LOGIN uid=0 euid=0 tty=tty2 ruser= rhost=  user=rama2
    Jan 21 04:48:35 india login: FAILED LOGIN 1 FROM (null) FOR rama2, Authentication failure
    Jan 21 04:49:25 india passwd: pam_unix(passwd:chauthtok): password changed for rama2
    Jan 21 06:02:52 india passwd: pam_unix(passwd:chauthtok): password changed for rama2
    Jan 21 06:10:28 india unix_chkpwd[3150]: password check failed for user (rama2)
    Jan 21 06:10:28 india login: pam_unix(login:auth): authentication failure; 
    logname=LOGIN uid=0 euid=0 tty=tty2 ruser= rhost=  user=rama2
    Jan 21 06:10:30 india login: FAILED LOGIN 1 FROM (null) FOR rama2, Authentication failure
    Jan 21 06:39:54 india passwd: pam_unix(passwd:chauthtok): password changed for rama2
    

    Thanks, Ramachandra

  5. David Han says:

    Dear Ravi
    Could you advise what does this {} \; parameter do in the command find / -size +100M -exec rm -rf {} \;

  6. srujan says:

    26.Find Last 50 Days Modified Files

    To find all the files which are modified 50 days back.

    # find / -mtime 50

    i think it should be -50 for last 50 days
    exact 50 days it should be 50

  7. Axel says:

    What is the difference between “Changed” (29) and “Modified” (30)?

    • Ravi Saive says:

      @Axel,

      29. The command find / -cmin -60 will list the files status was last changed x minutes ago and,

      30. The command find / -mmin -60 will list files data or content was last modified x minutes ago.

  8. Axel says:

    There’s a typo in:

    “19. Find all Empty Files
    To file all empty files under certain path.”

    “To file” -> “To find”

  9. Ramachandra says:

    Dear Sir,

    I want to search the hidden files for a particular duration of time.
    Ex..I need to search and list all the hidden files for the period Jan-10-2016 to Oct-10-2016.
    Please advise how to use the find command to search the above request.

  10. Khushal Bisht says:

    Can any one help me for using find command I want remove .xml or .jasons all files but I can’t find any command. For example, I have directory /dev and with in sub directory’s and in sub directories I have may files but I want delete only .xml or .jasons files only.

    If any command to use one time delete files Recursively

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

Join Over 300K+ Linux Users
  1. 202,035
  2. 9,267
  3. 38,621

Are you subscribed?