Rename all files with the same name but different extensions to other name with same extensions

I needed to rename:

FROM:

paper_guidelines.aux
paper_guidelines.loh
paper_guidelines.tex
paper_guidelines.pdf
….

TO
Aroca_R.aux
Aroca_R.loh
Aroca_R.tex
Aroca_R.pdf

Heres the fast and easy solution:

for i in paper_guidelines.*; do echo -n “$i “; EXT=`echo $i | awk -F ‘.’ ‘{ print $2 }’`; echo -n $EXT; mv $i “Aroca_R.$EXT”; done

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s