CharlieC3
6/22/2018 - 2:43 PM

Rename all files matching pattern

Renames all files matching a pattern recursively found within the current directory

#!/bin/bash
# Renames all files with a .template extension to a .j2 extenson
find . -type f -name "*.template" -exec bash -c 'mv $0 ${0/template/j2}' {}  \;