Just in case I need it again and don’t remember: for f in <OLDPATTERN>; do mv “$f” “$(echo “$f” | sed ‘s/<OLDPATTERN>/<NEWPATTERN>/’)”; done And to batch-rename strings in all text-type files in a folder: for f in <FILEPATTERN>; do if [[ $(file “$f” | grep “text”) != “” ]]; then sed -i ‘s/<OLDPATTERN>/<NEWPATTERN>/g’ “$f”; fi;… Continue reading Linux batch rename one-liner