[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 304
  • Last Modified:

File Name Search in Ubuntu

From the command line how do i search for a specific file name in ubuntu?
0
deklinm
Asked:
deklinm
3 Solutions
 
woolmilkporcCommented:
find /start/dir -type f -name file-to-search-for -print
0
 
farzanjCommented:
Do
man find

to see all options

All you need is a suspected directory and a filename.  As WPM said, you can certainly use -name option for the filename pattern or you can use -iname if you are not sure about the case like ABC or abc.

find /directory  -name '*txt'
0
 
deklinmAuthor Commented:
so i am tying to local a file called photo.jpg.

When i run the below syntax i receive an unknown predicate response.

find /start/dir -type f -name photo.jpg -print

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
woolmilkporcCommented:
Replace /start/dir with the name of the top level directory of the directory hierarchy which is suspected to contain the file in question.
0
 
farzanjCommented:
Try this

find . -type f -name photo.jpg

This would find for all the files under the current directory and all the sub directories.

May be you didn't change /start/dir.  It was just an example by WMP.
0
 
rushtoshankarCommented:
simply try
locate photo.jpg

If you added the file recently, try updatedb as an admin then enter the above command
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now