Search only in .php files under linux
Sometimes we need to search in only .php, .inc, .txt or template files for a string. Search can take very long time if there are thausend of files or GB-sized files(logs, xml/csv data etc). We can ignore all other files with a find-grep combination and save performance.
find /home/USERNAME -name *.php -exec grep -l 'MYSTRING' {} \;
Similar entries
- Search in text files recursively with PHP - Grep
- Using "Linux Find" command to get human readable directory sizes in public_html
- Argument List too Long
- How to compress/backup just ascii-text files with linux tar
- Update / overwrite files and directories recursively with Linux mv - cp commands
- need help for customizing PHP-grep files search
- Server Crash - "isc_socket_create: fcntl/reserved: Too many open files" [Howto Fix]
- How to recursively create md5 and sha1 sum of your files.
- How to change 'Welcome to the Frontpage', index-title of Joomla 1.5
- Using shared same Mysql Data dir on multiOS Linux+Windows Laptop
- Save / open .ico files (icons) with Adobe Photoshop CS4 64 / 32 Bit
- howto cp images, mp3 from multiple directory to one directory (find, exec, cp)
- Include both php/ html files, catch & assign output to a string variable
- Filezilla and plain-text clear, unsecure password storage
- Bing vs. Google: a small comparison
- Why tableless design, DIV vs. TABLE
- Howto protect admin.php / login.php with htaccess password
- Url manipulation with mod_rewrite and php-catcher for beginners
- Comparison of HDGuard, DeepFreeze, Dr-Kaiser and SteadyState
- Free Web-Hosting with PHP-MYSQL, FTP and no-ads

Post new comment