The rename program coming with Slackware is the really basic utility from util-linux-2.21.2 package.
I spend a lot of time on Debian and I'm used to the Perl rename with proper options (-n for dry-run actions) and powerful regex to play.
For example, I find always useful the grouping:
Code:
sim@rame:/tmp/test$ ls
file_0.pdf file_10.pdf file_3.pdf file_5.pdf file_7.pdf file_9.pdf
file_1.pdf file_2.pdf file_4.pdf file_6.pdf file_8.pdf
sim@rame:/tmp/test$ # -n = this is a test
sim@rame:/tmp/test$ rename -n 's/^(\w+)_(\d+)\.pdf$/$2_$1.pdf/' *pdf
rename(file_0.pdf, 0_file.pdf)
rename(file_1.pdf, 1_file.pdf)
rename(file_10.pdf, 10_file.pdf)
rename(file_2.pdf, 2_file.pdf)
rename(file_3.pdf, 3_file.pdf)
rename(file_4.pdf, 4_file.pdf)
rename(file_5.pdf, 5_file.pdf)
rename(file_6.pdf, 6_file.pdf)
rename(file_7.pdf, 7_file.pdf)
rename(file_8.pdf, 8_file.pdf)
rename(file_9.pdf, 9_file.pdf)
sim@rame:/tmp/test$ # it seems ok
sim@rame:/tmp/test$ rename 's/^(\w+)_(\d+)\.pdf$/$2_$1.pdf/' *pdf
sim@rame:/tmp/test$ ls
0_file.pdf 1_file.pdf 3_file.pdf 5_file.pdf 7_file.pdf 9_file.pdf
10_file.pdf 2_file.pdf 4_file.pdf 6_file.pdf 8_file.pdf
So, if you need a more powerful rename you can install the
File::Rename module from cpan: it will come with the rename script in /usr/local/bin.