Created
October 28, 2016 20:38
-
-
Save hex2010/0dbc2c2d0113e86552d80c3025833079 to your computer and use it in GitHub Desktop.
视频或图片文件用拍摄日期来命名
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
# 视频或图片文件用拍摄日期来命名 | |
# 图片改名 | |
exiv2 rename -F *.jpg | |
# 图片递归改名 | |
find . -name "*" -type f -exec bash -c 'exiv2 rename -r %Y%m%d-$(basename $(dirname $0))-%H%M%S -F $0' {} \; | |
# 视频递归改名 | |
find . -iname "*.mov" -exec bash -c 'echo mv $0 $(dirname $0)/$(exiftool -s2 -d %Y%m%d-%H%M%S -createdate $0 | awk -F " " "{print \$2}").mov' {} \; | |
# 删除重复文件 | |
fdupes -r /my/photo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment