Mac OS change creation and last modification dates of a folder

I believe following find/touch should work:

find /target/dir -exec touch '{}' \;

From man touch:

touch -- change file access and modification times

I am not sure whether this is problem with Mavericks or what, but touch -mt OR touch -t just update the modified and last opened time.

Maybe touch -mt OR touch -t commands are working with 10.8.4 and earlier.

For Mavericks, I found solution as below.

SetFile -d '12/31/1999 23:59:59' file.txt
            MM dd yyyy hh mm ss  fileName

To update all files in folder just use

SetFile -d '12/31/1999 23:59:59' *

Reference

Tags:

Macos