rename file names from lower case to upper case

Posted by Adnan on Stack Overflow See other posts from Stack Overflow or by Adnan
Published on 2010-04-11T13:50:07Z Indexed on 2010/04/11 13:53 UTC
Read the original article Hit count: 638

Filed under:

Hello,

I have about 2k of file that are currently in lower case like:

file_one.cfr
file_two.cfr
....

I am searching for a fast way to rename them to upper case so they would be like;

FILE_ONE.cfr
FILE_TWO.cfr
....

If I use from my shell;

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

I can get all file and the file extensions to upper case.

But the extension should remain in lowercase, so my approach does not work.

Any programming language is welcome.

© Stack Overflow or respective owner

rename file names from lower case to upper case

Posted by Adnan on Super User See other posts from Super User or by Adnan
Published on 2010-04-11T13:50:07Z Indexed on 2010/04/11 23:33 UTC
Read the original article Hit count: 638

Filed under:
|

Hello,

I have about 2k of file that are currently in lower case like:

file_one.cfr
file_two.cfr
....

I am searching for a fast way to rename them to upper case so they would be like;

FILE_ONE.cfr
FILE_TWO.cfr
....

If I use from my shell;

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

I can get all file and the file extensions to upper case.

But the extension should remain in lowercase, so my approach does not work.

Any programming language is welcome.

© Super User or respective owner

Related posts about rename