Skip to content

Instantly share code, notes, and snippets.

@sahildev001
Created August 13, 2022 04:23
Show Gist options
  • Save sahildev001/44183fe67e0ef2ca302a163c9559ca51 to your computer and use it in GitHub Desktop.
Save sahildev001/44183fe67e0ef2ca302a163c9559ca51 to your computer and use it in GitHub Desktop.
convert file names from uppercase to lowecase
#!/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
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