Mac OS X 修改文件创建时间、修改时间 + zip 过滤临时文件

https://apple.stackexchange.com/questions/99536/changing-creation-date-of-a-file

 

touch -t normally only changes the modification and access times. It only changes the creation time if the target time is before the original creation time.

touch -t 199912312359 file.txt
touch -t $(date -jf %FT%T 1999-12-31T23:59:59 +%Y%m%d%H%M%S) file.txt

SetFile -d always changes the creation time.

SetFile -d '12/31/1999 23:59:59' file.txt
SetFile -d "$(GetFileInfo -m test.txt)" file.txt

SetFile is part of the command line tools package which can be downloaded from developer.apple.com/downloads or from Xcode's preferences.

 
zip 过滤临时文件
zip -d filename.zip __MACOSX/\*
zip -d filename.zip \*/.DS_Store
posted on 2018-05-14 15:03  kelisi_king  阅读(3529)  评论(0编辑  收藏  举报