Terminal Batch Rename
MacOS X: Terminal, batch rename files:
Simple oneliner to batch rename files by extension.
for file in *.txt; do mv "$file" "`basename $file .txt`.md"; done
Or using sed
:
ls *.txt | sed -e 's/\(....\)\(..\)\(..\)\(..\)/mv \1\2\3\4.txt \4\3\2\1/' | sh
On OSX you may encounter an error with a message like:
sed: 1: "...": invalid command code.
It seems the -i
option expects a file extension. You can pass an empty string as the extension.