Terminal touch -t
In Sierra I used the terminal touch -t command. It changed the modified date but not the created date. How do I do the latter.
Thanks,
In Sierra I used the terminal touch -t command. It changed the modified date but not the created date. How do I do the latter.
Thanks,
Hi Barney,
I did not see any reference to -d date on the link you sent.
However, I spent a bit more time on the link and worked it out. The problem is that different commands require different formats for the date. Go figure?
SetFile -d "09/21/2016 11:11:11" <file path>
changes the creation date
touch -t 201609211111 <file path>
changes the modified date, but note that there are no seconds specified in this time convention
Thanks for the info. Now, using SetFile -d command I am getting the error "invalid date/time".
I have tried the usual string or numbers eg. YYYYMMDDhhmmss
and also %2017%04%04%11%11%11
What should I try next?
Thanks
Did you try using the example given in the link?
I have no idea how to use SetFile.
Here is an excerpt from the man page:
-d date Sets the creation date, where date is a string of the form:
"mm/dd/[yy]yy [hh:mm:[:ss] [AM | PM]]" Notes: Enclose the
string in quotation marks if it contains spaces. The date
must be in the Unix epoch, that is, between 1/1/1970 and
1/18/2038. If the year is provided as a two-digit year, it is
assumed to be in the 21st century and must be from 00 (2000)
through 38 (2038).
oxcart wrote:
Hi Barney,
I did not see any reference to -d date on the link you sent.
It was right in the first answer given.
All of unix is mostly written by different people at different times. Date formats are one of the more variable data types.
But, it appears you managed to sort it out.
Unless you are trying to set the creation date prior to the actual file creation date, touch won't work for you.
http://apple.stackexchange.com/questions/99536/changing-creation-date-of-a-file
BTW, I forgot to say thanks for all the good advice you have given over the years.
Terminal touch -t