From http://pcunix.com/SCOFAQ/scotec1.html#rename :
You can't do it as you would in DOS, but you can do it.
First, the "mv" command is what renames a file- you are "moving" it to a new name.
To rename with wildcards, you need to write a simple shell script. This can be done with any shell, but shells like ksh make it easier. For example, here's a couple of scripts to
rename a bunch of uppercase file names to lowercase:
# [A-Z]* matches upper case names
for i in [A-Z]*
do
j=`echo $i | tr '[A-Z]' '[a-z]'`
mv $i $j
done
Note the backtics ("`") carefully.
With ksh this becomes easier:
#!/bin/ksh
typeset -l j
for i in [A-Z]*
do
j=$i
mv $i $j
done
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.