Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mac OS change creation and last modification dates of a folder

Tags:

macos

What is the easiest way to change the creation and last modification dates of a folder (and recursively contained items) in Mac OS?

like image 613
Andrea Sindico Avatar asked Aug 03 '13 08:08

Andrea Sindico


People also ask

Is there a way to change the date modified on a file?

Unfortunately it's not possible to manually change the modified date of any file in Windows.

What does date modified mean on a folder Mac?

The "Date Modified" information of a folder does not reflect the modification date of a file or a sub-folder inside. The "Date Modified" information is always more recent than the latest modification date of any of the files and/or folders.


1 Answers

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

like image 169
Fahim Parkar Avatar answered Oct 15 '22 11:10

Fahim Parkar