<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Script to find any capital letter and change it to lower case? in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/script-to-find-any-capital-letter-and-change-it-to-lower-case/m-p/5051423#M96404</link>
    <description>Is there a way to find all files with a capital letter...any capital letter...in the filename and change it to lowercase?  It would have to be with the find command as the subdirectories are VERY deep in some cases.  &lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
    <pubDate>Wed, 06 Jun 2007 06:46:26 GMT</pubDate>
    <dc:creator>Coolmar</dc:creator>
    <dc:date>2007-06-06T06:46:26Z</dc:date>
    <item>
      <title>Script to find any capital letter and change it to lower case?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-find-any-capital-letter-and-change-it-to-lower-case/m-p/5051423#M96404</link>
      <description>Is there a way to find all files with a capital letter...any capital letter...in the filename and change it to lowercase?  It would have to be with the find command as the subdirectories are VERY deep in some cases.  &lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Wed, 06 Jun 2007 06:46:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-find-any-capital-letter-and-change-it-to-lower-case/m-p/5051423#M96404</guid>
      <dc:creator>Coolmar</dc:creator>
      <dc:date>2007-06-06T06:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: Script to find any capital letter and change it to lower case?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-find-any-capital-letter-and-change-it-to-lower-case/m-p/5051424#M96405</link>
      <description>i created a test directory and touched a few files that had upper case letters in the name&lt;BR /&gt;&lt;BR /&gt;this worked for that directory&lt;BR /&gt;&lt;BR /&gt;for file in `ls`&lt;BR /&gt;do&lt;BR /&gt;  mv $file `echo $file | tr '[:upper:]' '[:lower:]'`&lt;BR /&gt;&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;i would add * after ls if you want it to do subdirectories also</description>
      <pubDate>Wed, 06 Jun 2007 07:50:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-find-any-capital-letter-and-change-it-to-lower-case/m-p/5051424#M96405</guid>
      <dc:creator>Aussan</dc:creator>
      <dc:date>2007-06-06T07:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: Script to find any capital letter and change it to lower case?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-find-any-capital-letter-and-change-it-to-lower-case/m-p/5051425#M96406</link>
      <description>&lt;!--!*#--&gt;find &lt;DIRECTORY&gt; | while read fname; do&lt;BR /&gt;    lname=$(echo $fname | tr "[:upper:]" "[:lower:]")&lt;BR /&gt;    [ $lname != $fname ] &amp;amp;&amp;amp; mv $fname $lname&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Beware that this script may run a very long time (depending on amount of directories) since it finds every file and tests for capital letters.&lt;/DIRECTORY&gt;</description>
      <pubDate>Wed, 06 Jun 2007 07:52:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-find-any-capital-letter-and-change-it-to-lower-case/m-p/5051425#M96406</guid>
      <dc:creator>Bernd Reize</dc:creator>
      <dc:date>2007-06-06T07:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: Script to find any capital letter and change it to lower case?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-find-any-capital-letter-and-change-it-to-lower-case/m-p/5051426#M96407</link>
      <description>Thanks Aussan, but I would need to do a "find" of all files with a capital letter and change it to a lower case.  An "ls" will not work as the subdirectories go very very deep in some cases.</description>
      <pubDate>Wed, 06 Jun 2007 07:53:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-find-any-capital-letter-and-change-it-to-lower-case/m-p/5051426#M96407</guid>
      <dc:creator>Coolmar</dc:creator>
      <dc:date>2007-06-06T07:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: Script to find any capital letter and change it to lower case?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-find-any-capital-letter-and-change-it-to-lower-case/m-p/5051427#M96408</link>
      <description>Hi Coolmar,&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;FPATH=/foo/bar&lt;BR /&gt;find ${FPATH} -type f -print &amp;gt; /tmp/flist.${$}.out&lt;BR /&gt;while read L&lt;BR /&gt;do&lt;BR /&gt;{&lt;BR /&gt;    DIR=${L%/*}&lt;BR /&gt;    F1=${L##*/}&lt;BR /&gt;    F2=$(echo ${F1} | tr '[:upper:]' '[:lower:]')&lt;BR /&gt;    if [ ${F1} != ${F2} ]&lt;BR /&gt;    then&lt;BR /&gt;        mv ${DIR}/${F1} ${DIR}/${F2}&lt;BR /&gt;    fi&lt;BR /&gt;} done &amp;lt; /tmp/flist.${$}.out&lt;BR /&gt;rm -f /tmp/flist.${$}.out&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;PCS&lt;BR /&gt;</description>
      <pubDate>Wed, 06 Jun 2007 07:56:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-find-any-capital-letter-and-change-it-to-lower-case/m-p/5051427#M96408</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2007-06-06T07:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: Script to find any capital letter and change it to lower case?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-find-any-capital-letter-and-change-it-to-lower-case/m-p/5051428#M96409</link>
      <description>&lt;!--!*#--&gt;Hi:&lt;BR /&gt;&lt;BR /&gt;Perl makes this easy.  This will lowercase the names of all files with any uppercase letters.  This will be done recursively in the directory (or directories) that you pass as an argument.  Only files (not directory names) will be changed.&lt;BR /&gt;&lt;BR /&gt;The _current_working_ directory will be used if you run the script without any argument!&lt;BR /&gt;&lt;BR /&gt;# cat /.rename&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;#@(#)rename $ Find files with uppercase letters and lowercase - JRF $&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;use File::Find;&lt;BR /&gt;&lt;BR /&gt;my @path  = @ARGV ? @ARGV : getcwd() =~ m{^/$} ? ('/') : ('.');&lt;BR /&gt;my @files = ();&lt;BR /&gt;my ( $oldname, $newname );&lt;BR /&gt;&lt;BR /&gt;find( sub { push( @files, $File::Find::name ) if m/[A-Z]+/ &amp;amp;&amp;amp; -f $_ }, @path );&lt;BR /&gt;&lt;BR /&gt;for $oldname (@files) {&lt;BR /&gt;    ($newname = $oldname) =~ tr [A-Z] [a-z];&lt;BR /&gt;    rename( $oldname, $newname );&lt;BR /&gt;}&lt;BR /&gt;1;&lt;BR /&gt;&lt;BR /&gt;...run as:&lt;BR /&gt;&lt;BR /&gt;# ./rename /path&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 06 Jun 2007 08:00:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-find-any-capital-letter-and-change-it-to-lower-case/m-p/5051428#M96409</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-06-06T08:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: Script to find any capital letter and change it to lower case?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-find-any-capital-letter-and-change-it-to-lower-case/m-p/5051429#M96410</link>
      <description>The command pipeline below will do what you're looking for so give it a try:&lt;BR /&gt;&lt;BR /&gt;# find . -type f | awk '{f=tolower($0);system("mv "$0" "f)}'&lt;BR /&gt;&lt;BR /&gt;~hope it helps</description>
      <pubDate>Wed, 06 Jun 2007 10:47:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-find-any-capital-letter-and-change-it-to-lower-case/m-p/5051429#M96410</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-06-06T10:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: Script to find any capital letter and change it to lower case?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-find-any-capital-letter-and-change-it-to-lower-case/m-p/5051430#M96411</link>
      <description>One danger in these scripts is not testing for the existence of a file before moving. For example,&lt;BR /&gt;suppose that you have  files "myfile" (the good) and "MyfilE" (the bad). Unless a test is done first the "mv MyfilE myfile" will overwrite the existing file.</description>
      <pubDate>Wed, 06 Jun 2007 10:54:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-find-any-capital-letter-and-change-it-to-lower-case/m-p/5051430#M96411</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-06-06T10:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: Script to find any capital letter and change it to lower case?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-find-any-capital-letter-and-change-it-to-lower-case/m-p/5051431#M96412</link>
      <description>@Sandman!, &lt;BR /&gt;&lt;BR /&gt;Passing the entire $0 to tolower() causes directory names containing uppercase characters to also be converted to lowercase, resulting in "mv: ... No such file or directory".&lt;BR /&gt;&lt;BR /&gt;PCS</description>
      <pubDate>Wed, 06 Jun 2007 10:55:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-find-any-capital-letter-and-change-it-to-lower-case/m-p/5051431#M96412</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2007-06-06T10:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: Script to find any capital letter and change it to lower case?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-find-any-capital-letter-and-change-it-to-lower-case/m-p/5051432#M96413</link>
      <description>Thanks folks.</description>
      <pubDate>Wed, 06 Jun 2007 11:50:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-find-any-capital-letter-and-change-it-to-lower-case/m-p/5051432#M96413</guid>
      <dc:creator>Coolmar</dc:creator>
      <dc:date>2007-06-06T11:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: Script to find any capital letter and change it to lower case?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-find-any-capital-letter-and-change-it-to-lower-case/m-p/5051433#M96414</link>
      <description>&lt;!--!*#--&gt;Hi (again):&lt;BR /&gt;&lt;BR /&gt;Clay makes an excellent point!  We can easily handle this and cleanup the problem PCS noted:&lt;BR /&gt;&lt;BR /&gt;# cat ./rename&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;#@(#)rename $ Find files with uppercase letters and lowercase - JRF $&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;use Cwd;&lt;BR /&gt;use File::Basename;&lt;BR /&gt;use File::Find;&lt;BR /&gt;&lt;BR /&gt;my @path = @ARGV ? @ARGV : getcwd() =~ m{^/$} ? ('/') : ('.');&lt;BR /&gt;my @files = ();&lt;BR /&gt;my ( $dirname, $basename, $oldname, $newname );&lt;BR /&gt;&lt;BR /&gt;find( sub { push( @files, $File::Find::name ) if -f $_ &amp;amp;&amp;amp; m/[A-Z]+/ },&lt;BR /&gt;    @path );&lt;BR /&gt;&lt;BR /&gt;for $oldname (@files) {&lt;BR /&gt;    $dirname  = dirname($oldname);&lt;BR /&gt;    $basename = basename($oldname);&lt;BR /&gt;    ( $newname = $basename ) =~ tr [A-Z] [a-z];&lt;BR /&gt;    $newname = $dirname . '/' . $newname;&lt;BR /&gt;    if ( -f $newname ) {&lt;BR /&gt;        print STDERR "'$oldname' not renamed; '$newname' exists!\n";&lt;BR /&gt;    }&lt;BR /&gt;    else {&lt;BR /&gt;        rename( $oldname, $newname )&lt;BR /&gt;            or print STDERR "'$oldname' not changed\n";&lt;BR /&gt;    }&lt;BR /&gt;}&lt;BR /&gt;1;&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 06 Jun 2007 12:00:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-find-any-capital-letter-and-change-it-to-lower-case/m-p/5051433#M96414</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-06-06T12:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: Script to find any capital letter and change it to lower case?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-to-find-any-capital-letter-and-change-it-to-lower-case/m-p/5051434#M96415</link>
      <description>Slightly modifying Aussan's script : &lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;for file in `ls`&lt;BR /&gt;do&lt;BR /&gt;mv $file `echo $file |tr "[:lower:]" "[:upper:]"` &lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 06 Jun 2007 14:24:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-to-find-any-capital-letter-and-change-it-to-lower-case/m-p/5051434#M96415</guid>
      <dc:creator>Hunki</dc:creator>
      <dc:date>2007-06-06T14:24:17Z</dc:date>
    </item>
  </channel>
</rss>

