#!/bin/ksh # script to rename files with a numeric preference. # useful for converting MP3 files that you want numbered sequentially. # # establish starting count count="1" # establish loop... RUN script in the directory where the files are located. for a in `ls` do # change cp to mv to rename, cp used for testing to prevent damage to # files. The underscore must be contained in quotes. cp $a $count"_"$a # increment variable count by one. count="$((count+1))" # continues until all files in ls are numbered done