Skip to content

Instantly share code, notes, and snippets.

@callum
Created January 22, 2016 13:44
Show Gist options
  • Save callum/eabd65b7cc137dca7ab0 to your computer and use it in GitHub Desktop.
Save callum/eabd65b7cc137dca7ab0 to your computer and use it in GitHub Desktop.
#!/bin/bash
for file in "$@"; do
eval "$(stat -s "$file")"
formatted_date=$(date -r "$st_ctime" '+%Y-%m-%d_%H-%M-%S')
echo mv -v "$file" "${formatted_date}.jpg"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment