function make_change() { for f in *_TZ.json ; do fname=$(basename $f _TZ.json) ; newname=${fname}.json ; echo "cp $f to $newname"; cp -p $f $newname ; done } make_change cd tests/ make_change ls -l ../ ls -l