Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I would like to search for a file recursively under a directory. How do I search recursively for that file:

  1. in the directory I am standing in?
  2. in a specific directory?

The command should get a part of the file name and do the search, and return the full path of results, for example:

>> cd /
>> mysearch filename
/opt/dir/filename
/opt/dir2/filename23
/opt/dir3/filenamex
share|improve this question

closed as off topic by Wesley, Iain Jun 9 '12 at 22:15

Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

2  
Surely any Linux sysadmin knows about find and locate ? –  Iain Jun 9 '12 at 21:42
2  
This site is for professionals, who by definition know either how to do this simple stuff or how to find it - seriously, google 'find a file in linux' - you really thought it was easier to clog up this site, ignoring our FAQ and the whole point of the site, than do this google search? Please don't come back until you've learnt the basics and understand what this site it for. –  Chopper3 Jun 9 '12 at 22:04
add comment

1 Answer

up vote 2 down vote accepted

You need the find command

find . -name '*filename*'
share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.