linux

Bash Script to Lowercase Filenames

Simple bash script to convert all filenames in a directory to lowercase using tr command. Useful for organizing files.

A simple script that renames every file in the current directory to lowercase, using tr.

bash
  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  done