Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Find files with a certain extension, where the files contain a certain search term (See related posts)

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" {} \;

Comments on this post

Schetan posts on Apr 23, 2008 at 04:20
hi,
i am new with php. i have one problem that, i am uploaded image successfully and sa ve the path of that uploaded image in database. When i am searching image with its name then it will show proper output but by using extension it can show any output
so please help me. 


You need to create an account or log in to post comments to this site.


Click here to browse all 5059 code snippets

Related Posts