Rename several files on MAC using command line

Last updated on April 18, 2018

Share

Today i need to rename lots of files from .txt to .json.   I type the following on the terminal window:

for f in *.txt; do
mv "$f" "$(basename "$f" .txt).json"
done