#!/bin/sh for i in `find . -name index.php`; do cat /path/to/code.txt $i > /tmp/newfile.tmp mv /tmp/newfile.tmp $i done