Bash Rename File

Posted by Ligar Mugi Syahid on August 30, 2023
1 min read · Last Modified: January 21, 2024

prefix

for filename in *.jpg; do mv "$filename" "prefix_${filename}"; done;

postfix

for file in *.java; do mv -- "$file" "${file%.java}Response.java"; done;

Tags: [ bash  ]