Here’s a simple bash one-liner to convert mixed-case filenames into Title Case:
rename 's/(\S+)/\u\L$1/g' *
This forces the file extension to lower-case as well.
rename -n to test the command without changing anything on the filesystem.
(Adapted from this PerlMonks FAQ.)
I have a bunch of inconsistently named files like:
HERE COMES THE SUN.mp3 hey jude.mp3 The lOng and wiNDing Road.mp3
I want them to appear as:
Here Comes The Sun.mp3 Hey Jude.mp3 The Long And Winding Road.mp3
Two Line Approach
First, rename all files to lower-case:
rename 'y/A-Z/a-z/' *
rename 's/(^|[\s_-])([a-z])/$1\u$2/g' *