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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM