Created
March 8, 2017 16:15
-
-
Save anthonynsimon/f8719aed7633f63ff3fb039ee23be133 to your computer and use it in GitHub Desktop.
Bash script preprend timestamp to filename
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
#!/bin/bash | |
for f in *; do mv -- "$f" "$(stat -f "%Sm_%N" -t "%Y%m%d" "$f")"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example input:
DSC00001.JPG
, output:20170303_DSC00001.JPG