Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Change File Name From Upper To Lower Case

DZone's Guide to

Change File Name From Upper To Lower Case

·
Free Resource
This script requires perl, and a modern shell with ls (this was written/tested using Bash).  It also will not work recursively without some modifications.


for file in `ls -1|perl -ne 'print "$_" if (/[A-Z]/);'`
do
  mv ${file} `echo ${file}|perl -ne 'chomp;print "$_" if (tr/A-Z/a-z/);'`;
done
Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}