1

Some how I have image files as Texteditor - documents with no extension. Can I use the command tool rename to change all the files in *.jpg? Using terminal on mac.

Something like rename *.* *.jpg or rename . *.jpg doesn't work.

Tdebeus
  • 1,519
  • 5
  • 21
  • 43

1 Answers1

0

This was answered here.

cd to the directory/folder the files are in preferably an images folders because this works on EVERYTHING without an extension including folders and adds to other extensions like .json (file extension will become .json.jpg) or another .jpg (file extension will become .jpg.jpg:

for f in *;do mv $f $f.jpg;done

I work on a Mac as well and I actually had this question bookmarked. I tried it out to make sure it still works in terminal and it does.