How to Change File Extensions of Files via Command Line in Mac OS
![]()
Command line users may find it helpful to change and rename the file extension of a group of files in a directory. For example, let’s say you have a batch of files with the file extension “.txt” but you want all of those the file extensions to be “.py” instead. That’s what we’re going to demonstrate here by relying on simple bash scripting to change a group of file extensions at the command line of Mac OS / OS X, but this will also work in linux and other unix flavors too.















