Bulk Rename File Extensions Recursively Much of the information on the Web that I found related to bulk renaming files did not work recursively for me; most of it seemed to only rename files within the current working directory. As I am in the process of redesigning a rather large website and will be implementing the new site in PHP, I wanted to quickly be able to rename all of the .html files so that they would have .php file extensions. Some files are as much as five levels deep so it is important to me to be able to recursively rename all of the .html file extensions. I’ve put together a simple script that will perform this task. You’ll want to save the script to the directory from where you wish to start renaming files, and make sure that it’s executable. In the script, I have specified that any .html files will be renamed with a .php file extension. You’ll want to edit the code to suit your own needs. Here’s the meat of it: find . -name "*.html" | while read i; do mv "$i" "${i%.html}.php"; done I have a working script to rename pictures in the /usr/local/sbin/scripts directory