$ mkdir test
$ cd test
$ touch X x
$ ls -l
total 0
-rw-r--r-- 1 alexharvey wheel 0 26 Sep 20:20 X
$ mv X x
$ ls -l
total 0
-rw-r--r-- 1 alexharvey wheel 0 26 Sep 20:20 x
# lower case all files in current dir & subdirs
for d in ./**/ ; do (cd "$d" && for x in ./*/ ; do (cd "$x" && for f in *; do mv "$f" "$f.tmp"; mv "$f.tmp" "`echo $f | tr "[:upper:]" "[:lower:]"`"; done); done); done
#list all directories
for f in ./**/ ; do echo $f; done
# lower case all files in a directory
for x in ./*/ ; do (cd "$x" && for f in *; do mv "$f" "$f.tmp"; mv "$f.tmp" "`echo $f | tr "[:upper:]" "[:lower:]"`"; done); done