Skip to content

Instantly share code, notes, and snippets.

@haraki
Created July 9, 2019 14:02
Show Gist options
  • Save haraki/38ed518ac471af25b3e600c47b9a8633 to your computer and use it in GitHub Desktop.
Save haraki/38ed518ac471af25b3e600c47b9a8633 to your computer and use it in GitHub Desktop.
ディレクトリ内のJPEGファイルの名前を {YYYYMMDD_hhmmss}.JPG に置き換える bash スクリプト
#!/bin/bash
for file in `find . -name '*.JPG'`; do
echo $file
date=`date -r $file "+%Y%m%d_%H%M%S"`
mv $file "${date}.JPG"
done
@haraki
Copy link
Author

haraki commented Jul 9, 2019

macOS でのみ動作確認済

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment