mv batch rename extension code example Example: mv batch rename extension for f in *.oldext; do mv -- "$f" "${f%.oldext}.newext" done