www.LinuxHowtos.org


Renaming Files

Often files need to be converted from uppercase to lowercase. Sometimes this is a side effect of moving from case-insensitive file systems to case-sensitive ones.

Here's a quick shell command that will convert everything in the current directory from uppercase to lowercase.

Code Listing 1

for n in *; do mv $n `echo $n | tr '[ :upper:]' '[ :lower:]'`; done

From http://www.gentoo.org/news/en/gwn/20040510-newsletter.xml

back