Created
July 28, 2020 20:34
-
-
Save kampfgnu/793f2b25d3c412e27fd3c0a6c73b71f6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cd $1 | |
for file in *.{JPG,jpg,JPEG,jpeg} | |
do date=$(stat -f %B $file) | |
dateFormatted=$(date -r $date +%Y-%m-%d' '%H.%M.%S) | |
mv $file "$dateFormatted.jpg" | |
done | |
for file in *.{PNG,png} | |
do date=$(stat -f %B $file) | |
dateFormatted=$(date -r $date +%Y-%m-%d' '%H.%M.%S) | |
mv $file "$dateFormatted.png" | |
done | |
for file in *.{MOV,mov} | |
do date=$(stat -f %B $file) | |
dateFormatted=$(date -r $date +%Y-%m-%d' '%H.%M.%S) | |
mv $file "$dateFormatted.mov" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment