35 Practical Examples of Linux Find Command

If you have any questions or problems regarding this article and want help within 24 Hours? Ask Now

Ravi Saive

Simple Word 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.

Receive Your Free Complimentary eBook NOW! -

Download Free Linux eBooks

Advanced Bash-Scripting Guide
Linux Bible
A Newbie's Getting Started Guide to Linux
Ubuntu Linux Toolbox: 1000+ Commands

You may also like...

54 Responses

  1. Bharatdan Gadhavi says:

    Hi Ravi,

    I got result in SSH with one of find syntax.
    But I got too many results which I can not see all in SSH window.
    Can you suggest any syntax using which I can store all search result in any text file or something and I can have look at that file later on when needed?

    • Ravi Saive says:

      Use following example command to store all data about find command on a file.

      find / -name *.abc >> somefile.txt
  2. bapu says:

    Hello sir,

    Superb explantion. Very helpful. Many thanks

  3. Dimitris Maraidonis says:

    You can also use this
    find . -type f -name “tecmint.txt” -delete
    instead of this
    find . -type f -name “tecmint.txt” -exec rm -f {} \;

  4. Neil Niekerk says:

    The content is excellent at TecMint, but the pages cannot be saved/printed usefully. I save all web-urls in .pdf. Tecmint pages are useless to print.

  5. Marcos Vinicius Linhares says:

    I think you can improve your Part IV with this: http://serverfault.com/a/122831

  6. Rahul Kumar says:

    Another solution is :
    find . -name -exec mv {} \;

  7. sunny desouza says:

    quick question :-

    How do we find a file and then we rename (mv) the same file with one command
    Does -exec option work with it ?

    Any Examples ?

  8. sunny desouza says:

    Dear Tecmints ,

    i understand that this works for one of the files to find apply the execute the action on those files

    $ find / -name “error_*.txt” -exec ls -lrathi ‘{}’ “;”

    but can you please provide examples on multiple files how do we do it ?

    Examples : – if there are “find_*.txt” “list_*.csv” and more

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Join Over 75000+ Linux Users
  1. 51334
  2. 2657
  3. 16705

Enter your email to get latest Linux Howto's