total-commander

Total commander rename files in folders


I need rename files in my folders.

Each foder contain next files:

1.png

2.png

3.png

I need to rename as below:

1.png > a.png

2.png > b.png

3.png > c.png

Thanks a lot!


Solution

  • Here's what I do from the shell prompt to rename a bunch of files in a PictsFolder.

    Create a file called rename.sh

    #!/bin/bash
    cd /Users/jscarry/Desktop/PictsFolder
    mv 1.png a.png
    mv 2.png b.png
    exit
    

    chmod it to be executable and then run it from the command line.

    jscarry$ /Users/jscarry/Files/renamePicts.sh 
    

    Be sure to escape special characters like spaces in your file names.

    e.g. File\ Name\ With\ Spaces.png