cd /path/to/php_files/ add-exits-to-php.pl *.php #### cd /path/to/php_files/ ls | grep '\.php$' | xargs add-exits-to-php.pl