Skip to content

Instantly share code, notes, and snippets.

@stwobe
Created December 13, 2022 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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