From: Brian Candler Date: 2009-12-14T23:55:12+09:00 Subject: Re: one-liner for lowercasing files Peter Bailey wrote: > Can someone please suggest a simple Ruby one-liner to lowercase a > filename (in a directory)? Lowercase the *contents* of a file, or its *name* ? For the contents, this example lifted almost verbatim from "man ruby". ruby -p -i.bak -e '$_.downcase!' /tmp/junk To lowercase the names of all files: Dir["*"].each { |fn| File.rename(fn, fn.downcase) } Beware that even ruby 1.9 won't lowercase anything other than plain A-Z. -- Posted via http://www.ruby-forum.com/.