Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save goooooouwa/afaf8f99c1a3419444a43e2e85a2f287 to your computer and use it in GitHub Desktop.
Save goooooouwa/afaf8f99c1a3419444a43e2e85a2f287 to your computer and use it in GitHub Desktop.
Batch rename files in directory with date modified timestamp as prefix of the filename
# ref: https://unix.stackexchange.com/questions/43338/renaming-a-bunch-of-files-with-date-modified-timestamp-at-the-end-of-the-filenam
for f in *; do mv -- "$f" "$(date +%Y-%m-%d -r $f)-$f"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment