Page 1 of 1

rename files&folders to lowercase script for Linux pleas

Posted: Sun Sep 17, 2006 3:57 pm
by Diedel
Can someone here give me a Linux script/command to recursively rename files and folders to lowercase please?

Posted: Sun Sep 17, 2006 9:11 pm
by fliptw

Code: Select all

for i in `ls PATTERN`; 
do mv $i $(echo $i | tr [A-Z] [a-z]); 
done
replace PATTERN with, im guessing, -r dirname/*

google for \"bash rename lowercase\" for more stuffs

Posted: Mon Sep 18, 2006 4:54 am
by Diedel
Thx flip. :)

Posted: Tue Nov 07, 2006 5:40 pm
by Diedel
Doesn't work recursively because the folders aren't put in front of each filename by ls, but it saves enough work to rename each folder's contents already.