How to Change Filenames to lowercase Case in Linux
Many time you may need to change the file or folder name case, for example lower to upper, upper to lower or toggle the case. I am giving you to the best solution to change the folder name case. We need to create a command for easy access. First of all create a script in “/usr/local/bin” folder and give it the execute permission, so any user can access this function as a command. I named this script lcf (lower case file) but you can user your name that you can easily remember and identify. Note: You need super user privilege.
Create a script and put this script named “lcf” in /usr/local/bin and type “chmod a+x lcf”.
sudo vi /user/local/bin/lcf#!/bin/sh# uppercase any filenames with lowercase charsfor file in $*doif [ -f $file ] then lcfile=`echo $file | tr '[:upper:]' '[:lower:]'` if [ $file != $lcfile ] then mv -i $file $lcfile fi fidonesudo chmod a+x /user/local/bin/lcfUses:
$ lcf
OR
$ lcf [ ...]Chage all file in a folder:
$ lcf `ls *`