Skip to content

Instantly share code, notes, and snippets.

@jeffcatania
Created March 27, 2013 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffcatania/5254510 to your computer and use it in GitHub Desktop.
Save jeffcatania/5254510 to your computer and use it in GitHub Desktop.
convert all file names in the current directory to lower case
#!/bin/sh
# lowerit
# convert all file names in the current directory to lower case
# only operates on plain files--does not change the name of directories
# will ask for verification before overwriting an existing file
# source: http://www.linuxjournal.com/content/convert-filenames-lowercase
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment