How do I search my Linux / UNIX server for a file?

by on April 11, 2006 · 9 comments· last updated at May 1, 2008

Q. How do I search Linux box for a file?

A. You need to use find command, which search for files in a directory hierarchy (file system) and prints information about the files it found. It is run like as follows:

find {dir-name} -name {file-name}

Find command examples

Find out file called foo.txt:
# find / -name foo.txt
Find out httpd.log file:
# find / -type f -name httpd.log

See also:



You should follow me on twitter here or grab rss feed to keep track of new changes.

Featured Articles:

{ 9 comments… read them below or add one }

1 Dr.M.Bärmann April 15, 2008 at 10:35 pm

Make it more easy. i did not understan nothing. can you tell people simply things? I still doo not know who you areß what are you dooing? nothing is that what you want? think abaut. Young People may know this, but what abaut the 50-60 generation.

Reply

2 Jack March 4, 2011 at 4:44 am

Obvious, but still pretty funny… *and* you fell for it. Didn’t you think it was a bit odd he could spell “generation” but not “do”?? Uh, herr-o?

Reply

3 Justin Pinho March 30, 2009 at 6:39 pm

If you can’t construct a sentence Dr M Barmann, you shouldn’t even bother.

Reply

4 Frank Ucker July 14, 2009 at 10:14 am

The answer is simple enough to understand although the Doc’s comment isn’t. Thanks for the tip.

Reply

5 bob borum January 13, 2011 at 4:54 am

I have a new freespire program and like it , but I do have issues , I can not seam to get my lexmark x3550 printer to work the soft ware disk will not run , an other issue is the yahoo messanger I get is yahoo beta I would like the stanard messager 10 , the last issue is I can not find the clock , thank you for your time bob

Reply

6 bob borum January 16, 2011 at 3:57 am

I still can not find the clock on freespire

Reply

7 Justin November 22, 2011 at 9:59 am

Thanks for this command. It was quite useful.

Reply

8 JN January 27, 2012 at 2:41 pm

Exactly what i was looking for! thanks!

Reply

9 razor 3928 February 29, 2012 at 11:58 pm

Please step away from the linux server. You will crash the box and hurt yourself. Call your grandkids they will help you.

Thanks for the chuckle…..

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <kbd> <blockquote> <pre> <a href="" title="">

Tagged as: , , , , , ,

Previous Faq:

Next Faq: