Batch-rename file extensions on Mac (jpeg → jpg)
Change the extension of every matching file in a folder with one shell loop.
01Command
$ for f in *.jpeg; do mv "$f" "${f%.jpeg}.jpg"; done02What it does
The loop walks every *.jpeg file in the current folder; ${f%.jpeg} strips the old suffix and .jpg is appended. Only names change — the file contents and the actual image format are untouched (a true format conversion needs sips). Swap the extensions to rename any other pair, e.g. *.txt to *.md. Preview first by replacing mv with echo mv to print what would happen without changing anything.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- macOS mv command referenceEvidence: mv renames files; the shell ${var%pattern} expansion strips the matching suffix from the filename.
Last verified: 2026-09-16 · Category: Files & Folders
06Related solutions
List the biggest files in your home folder that are eating disk space.
Make a file or folder invisible in Finder without moving or renaming it.
Point macOS screen captures at any folder you choose instead of the desktop.