How to find a file in Unix, Linux, Aix, Solaris.

May 15, 2009
By Andrew Lin

If you are not sure about the name of the file and which directory it stored in then you can use the find command to search for it.

The Find command is common to all variants of Unix, Aix, Solaris, and Linux. The variables may differ slightly depending on the Operating System.

Here is an example of how to find all files that ends with the letters db.

find . -name ‘*db’ -print | more

The period (.) sign represents the current working directory. Find will search the current directory and all it’s subdirectories.

-name – this preceeds the actual name of the file.

‘*db’ – the * sign is a wildcard, meaning any files name that ends with db. This is enclosed in single quote.

-print – this will print the result to screen. Depending on the version of Unix/Linux this switch may be optional.

| more – the pipe (|) sign followed by more stops the results from scrolling off the screen, util any key is pressed. This command is vary handy when many results are found.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Reddit
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot
  • del.icio.us
  • IndiaGram
  • IndianPad

Tags: , ,

4 Responses to “ How to find a file in Unix, Linux, Aix, Solaris. ”

  1. data file recovery on December 24, 2009 at 8:08 pm

    Awesome website. I’m very happy I stumbled onto it through google, I’m going to have to add another one to the old bookmark list :)

  2. click on December 16, 2009 at 2:46 pm

    Hello! I do not see a condition of use of the information. Whether it is possible to copy the text written by you on the site if to put the link to this page.

    • Andrew Lin on December 17, 2009 at 3:04 pm

      Sure, I have no problem with that as long as you link back to me.

  3. Bleach Download on December 7, 2009 at 4:50 pm

    Hi, i meet thought i’d post and let you undergo your blogs layout is really messed up on the K-Melon browser. Anyhow keep up the good work.

Leave a Reply