Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Find Files With A Certain Extension, Where The Files Contain A Certain Search Term

DZone's Guide to

Find Files With A Certain Extension, Where The Files Contain A Certain Search Term

·
Free Resource
Searches the current directory and deeper for files ending with the 'php' extension, where the file itself contains 'search_term'. Useful if you're searching a large website with lots of images and you only want to find a certain function or variable.


find ./ -type f -name \*.php -exec grep -il "search_term" {} \;
Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}