ubuntu rename all files lowercase commands

C++
#!/bin/sh

for x in `ls`
  do
  if [ ! -f $x ]; then
    continue
    fi
  lc=`echo $x  | tr '[A-Z]' '[a-z]'`
  if [ $lc != $x ]; then
    mv -i $x $lc
  fi
  donerename 'y/A-Z/a-z/' *

Source

Also in C++: