Rename several files on MAC using command line

  • 05 Apr, 2018

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

Related Posts

How to Fix Error 513 When Unzipping Large Files on macOS

  • 25 Mar, 2025

If you’ve ever tried to unzip a large file on macOS and encountered the mysterious "Error 513," you’re not alone. This pesky error can pop up unexpectedly, leaving you scratching your head and wonderi

How to Fix Error 513 When Unzipping Large Files on macOSRead More

Python script to organize photos

  • 03 Mar, 2025

"I have lots of photo files. Since 2006, when I purchased my first digital camera, the number of photos has grown quickly, and after getting an iPhone, the number of photos exploded. With the high nu

Python script to organize photosRead More

How to Install watch on macOS Sequoia

  • 06 Feb, 2025

The watch command is a useful utility in Unix-like systems that allows you to execute a command periodically and display its output. However, macOS does not come with watch pre-installed. If you're ru

How to Install watch on macOS SequoiaRead More