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

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

Questions on Server Fault are expected to relate to 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

You need the find command

find . -name '*filename*'

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