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}' {} \;