#find php files and convert them to phps files find . -name "*.php" | while read i do outfile=${i%.php}.phps echo $outfile cp $i $outfile done