0

Batch copy then rename multiple files on linux

Posted December 29th, 2011 in Linux, Operating Systems and tagged by Louie Miranda

You can use this script to rename multiple files on linux.

for i in us_*;
do cp $i `echo $i|sed ‘s/us_/nz_/g`;
done

The first line will loop to your files matching us_*. Then it will copy the listed files, piping it to sed to do a quick replacement from us_* to uk_*.

Hope this helps :)

Leave a Reply