Change creation date of a file using terminal command touch

Hi, I'm trying to change a file's creation date ("date created") using the terminal command touch (touch -t 201904171523 filename.xxx) but it won't do that: it only changes modification date ("date modified"). I'm confident that it used to work in "High Sierra". Has anyone a clue? Thank you

MacBook Air 13", macOS 10.14

Posted on Apr 29, 2019 10:01 PM

Reply

Similar questions

4 replies

Apr 29, 2019 10:43 PM in response to Kappy

Hi Kappy, if I'm not wrong (I might, though) I used a few workarounds to change modification date/time using the -mt options to the touch command and the -t option alone to change the creation date. I stumbled on a few hints here and there that helped me do that (change both creation and modification dates/times). I was just curious to find out why it doesn't seem to work out on Mojave the way it used to in Sierra and High Sierra. Thank you again.

Apr 29, 2019 10:20 PM in response to rudi673

The man page for Touch does not indicate a change to the creation time:


The touch utility sets the modification and access times of files. If

any file does not exist, it is created with default permissions.


By default, touch changes both modification and access times. The -a and

-m flags may be used to select the access time or the modification time

individually. Selecting both is equivalent to the default. By default,

the timestamps are set to the current time. The -t flag explicitly spec-

ifies a different time, and the -r flag specifies to set the times those

of the specified file. The -A flag adjusts the values by a specified

amount.


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.

Change creation date of a file using terminal command touch

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