In this post I will show you how I used a single line script that I found buried within a comment to a Unix.Stackexchange answer to rename all the file extensions in a directory.
The single line script
for f in *.OLD; do mv -- "$f" "${f%.PREVIOUS}.NEW"; done
To use, start a new terminal session and change to the directory that were the files reside. Copy and paste the command into the terminal, replacing the two occurrences of OLD and the single NEW.
In the example below I used the script to rename all the file extensions from .h264 to .mp4
for f in *.h264; do mv -- "$f" "${f%.h264}.mp4"; done
Acknowledgements
This Unix.Stackexchange comment was the inspiration for this post.