Rename directories to lowercase
By Geoffrey on Thursday 10 July 2008, 15:35 - Geekeries - Permalink
Using a single (and somewhat simple) shell line, you can rename any directory to its lowercase version.
for i in *; do lcase=`echo $i | tr A-Z a-z`; if [ ! -d $lcase ]; then mv $i $lcase; fi; done;
Viva el chell !
Comments
Using a single (and somewhat simple) ruby shell line, you can rename any file to its lowercase version.
Dir.new('.').entries.each{|f| File.rename(f,f.downcase) if !(f =~ /(\.|\.\.)/) and File.directory?(f) }Viva el ruby chell !
I do not have ruby installed on this server :-)
and your oneliner does not exactly the same as mine