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,

Posted on Apr 11, 2017 3:55 AM

Reply
6 replies

Apr 11, 2017 11:05 AM in response to Barney-15E

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

Apr 11, 2017 5:28 AM in response to oxcart

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).

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Terminal touch -t

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.