Skip to content

Instantly share code, notes, and snippets.

@stwobe
Created December 13, 2022 18:09
Show Gist options
  • Save stwobe/6368cfc9b79758daedaea2d3003326aa to your computer and use it in GitHub Desktop.
Save stwobe/6368cfc9b79758daedaea2d3003326aa to your computer and use it in GitHub Desktop.
Add .jpeg extenstion to files
find . -type f \
-not -name "*.*" \
| while read FILE; \
do if [ $(file --mime-type -b "$FILE") \
== "image/jpeg" ]; \
then mv "$FILE" "$FILE".jpg; fi; done;
# link
https://www.baeldung.com/linux/bash-add-file-extension
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment