Rename files in Unix

From Rizzo_Lab
Jump to: navigation, search

rename.sh

#!/bin/bash
for file in *rec.nohydrogens.pdb
do
       code=`echo $file|awk -F"." '{print $1}'`
       name=$code.rec.moe.pdb
       mv $file $name
done