Friday, August 11, 2017

Batch renaming multiple files in Linux


[1] https://stackoverflow.com/questions/208181/how-to-rename-with-prefix-suffix

using 'rename'
rename 's/(.*)$/new.$1/' original.filename
shell script
for filename in *.jpg; do mv "$filename" "prefix_$filename"; done;
brace expansion
mv {,new.}original.filename


No comments: