Had to help a friend which was moving his site from an "ancient" php version to a new one, where you have to change all the <? to <?php. This had to be done on all sub directories, and only on .html and .php files. I felt a one-liner tingling in my head, so here it is:
find . \( -name "*.html" -o -name "*.php" \) -print | xargs sed -i 's/<? /<?php /gm'