Friday, January 3, 2014

Batch rename files from OS X terminal

As an example, let’s say you want to rename *.cxx files to *.cpp. The code below will do it:

for file in *.cxx
do
    echo mv "$file" "${file/.cxx/.cpp}"
    mv "$file" "${file/.cxx/.cpp}"
done

Written with StackEdit.

No comments:

Post a Comment