This is simple script which rename files based on some pattern
For example rename all files AABBBCCC and replace BBB with DDD
./ren „AAABBBCCC“ „BBB“ „DDD“
#!/bin/bash
# renames.sh
# basic file renamercriteria=$1
re_match=$2
replace=$3for i in $( ls *$criteria* );
do
src=$i
tgt=$(echo $i | sed -e „s/$re_match/$replace/“)
mv $src $tgt
done
Вашият коментар