find . -name "*.[ch]pp" -type f | xargs perl –i.bak –p –e 's/old/new/g;'or non recursive:
perl -pi -w -e 's/search/replace/g;' *.php-e means execute the following line of code.
-i means edit in-place
-w write warnings
-p loop
Software, web, and programming tips: C++, Java, C, Linux, Windows, Cygwin, Firefox, Vim, WWW, RSS
find . -name "*.[ch]pp" -type f | xargs perl –i.bak –p –e 's/old/new/g;'perl -pi -w -e 's/search/replace/g;' *.php-e means execute the following line of code.
-i means edit in-place
-w write warnings
-p loop
find . -name <file-pattern> -exec <command> {} \;find . -name *.txt -exec grep -Hn hello {} \;#!/bin/bash
find . -name *.[ch]pp -exec grep -Hn "$1" {} \;