-3

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
alwbtc
  • 229
  • 1
  • 4
  • 7
  • 2
    Surely any Linux sysadmin knows about find and locate ? – user9517 Jun 09 '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 09 '12 at 22:04

1 Answers1

2

You need the find command

find . -name '*filename*'
Andy Lester
  • 740
  • 5
  • 16