Possible Duplicate:Renaming multiple files (changing extension) Suppose that in my current/working directory I have five files:file1.xvgfile2.xvgfile3.xvgfile1.epsfile2.epsIs there any way that I can rename all files in the current/working directory with the extension .xvg and give them the new extension .txt (leaving the .eps files alone)?  Can this be done with rename, mv, or mmv perhaps?  I am using Ubuntu Linux.  Thanks!
How can I rename all files in the current directory having a particular extension to another extension?
bash;ubuntu;filesystems;directory;rename
For your particular question this command will work. Verify that you are happy with the proposed renaming, then drop the -n to have the operation proceed.rename -n 's/\.xvg$/.txt/' *.xvgThis basically means for all files with the .xvg extension in the current directory find the files that end ($) with .xvg and change that part of the name to .txt.More detail and an example below.Yes, the rename command will do this for you. A short example where I rename all of my files with the .html extension to .html_bak, ignoring other files in the directory.I would strongly recommend using the -n command line option first (explained below) to see what changes would happen before executing the actual command.What I start out with:$ lsa.html  a.txt  b.html  htmlfilethe -n means do a trial run .. just show what would change, don't change anything!$ rename -n 's/\.html$/.html_bak/' *a.html renamed as a.html_bakb.html renamed as b.html_bakStill have the original files.$ lsa.html  a.txt  b.html  htmlfileNow for real:$ rename  's/\.html$/.html_bak/' *Files have been renamed. $ lsa.html_bak  a.txt  b.html_bak  htmlfileIn the above examples I use * to specify the files to be considered for the rename operation. I could have restricted this to .html files only with *.html.For more information consult the rename man page