Monday, December 11, 2006

Linux : renaming files with rename in a loop

Following command (a small shell script) changes file extensions of all files from .TXT to .txt in the working directory.

for file in `find . -type f -name "*.TXT"`; do rename .TXT .txt $file; done

The above works in bash. For use in other shells, you'll have to change the looping sytax.

3 comments:

  1. Anonymous11:01 AM

    This comment has been removed by a blog administrator.

    ReplyDelete
  2. Anonymous9:35 PM

    I just love your weblog! Very nice post! Still you can do many things to improve it.

    ReplyDelete
  3. Anonymous9:58 PM

    Amiable fill someone in on and this enter helped me alot in my college assignement. Thanks you for your information.

    ReplyDelete