changefilename

in unix how can you rename  usedindex to usedindex.sql
tonydbaAsked:
Who is Participating?
 
Dan CraciunConnect With a Mentor IT ConsultantCommented:
mv usedindex usedindex.sql

Open in new window

HTH,
Dan
0
 
SandyCommented:
#mv usedindex usedindex.sql
#rename usedindex usedindex.sql usedindex

TY/SA
0
 
serialbandCommented:
If you're just renaming one at a time use mv file file.sql as Dan Cracium as pointed out.  This command will work on all POSIX compliant systems.

The rename script is a relatively "modern" perl script for renaming multiple files and may or may not exist on your system depending on the gnu packages you have installed.  It's certainly not default on Solaris.  It's probably on most of the  popular distros of linux, but likely not on DSL or any of the distros designed for a tiny footprint.  Depending on your environment, you may not want to use or rely on rename.

You would use perl regular expressions for remane:
rename * *.sql
rename 's/\.bak$//' *.sql
0
 
tonydbaAuthor Commented:
Thank you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.