Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subfolder search

Status
Not open for further replies.

cmhunt

Programmer
Apr 17, 2001
119
GB
I would like to do a wildcard search on a filename including all subfolders of the current directory. I have a script which does something similar but requires the full filename. Can anyone help?

Thanks
 
For files and dirs:
[tt]find . -print | grep pattern[/tt]
For files:
[tt]find . -type f -print | grep pattern[/tt]
For file contents:
[tt]find . -type f -print | xargs -n2 grep pattern[/tt]
Cheers, Neil :)
 
With find, for files you can also do :

find . -type f -name 'pattern' -print Jean Pierre.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top