Skip to content

Instantly share code, notes, and snippets.

@tacostea
Last active March 6, 2020 13:27
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 tacostea/2084b4dcde57cc07e56dc0ba46f5c0eb to your computer and use it in GitHub Desktop.
Save tacostea/2084b4dcde57cc07e56dc0ba46f5c0eb to your computer and use it in GitHub Desktop.
A bash one-liner to rename directories based on modified date from PENTAX format (id_mmdd) to Adobe format (yyyy-mm-dd)
for d in $(find . -name "*_*" -type d); do mv "$d" $(date +%Y-%m-%d -r $(find "$d"/*|head -1)); done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment