Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Command Line Bash - Change file date modified to date taken/created - For each file in directory - Linux/Mac
- # 1. Example with all files in current directory:
- for f in $(ls .);do touch -t $(date -r $(stat -f%B $f) +%Y%m%d%H%M) $f;done
- # 2. Example with all files in specific directory:
- # specific directory is for example:
- # /Users/adamrosloniec/Downloads/BACKUP-PHOTOS/
- for f in $(ls /Users/adamrosloniec/Downloads/BACKUP-PHOTOS/);do touch -t $(date -r $(stat -f%B $f) +%Y%m%d%H%M) $f;done
- # 3. Example with only .jpg files in specific directory:
- for f in $(ls /Users/adamrosloniec/Downloads/BACKUP-PHOTOS/*.jpg);do touch -t $(date -r $(stat -f%B $f) +%Y%m%d%H%M) $f;done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement