1

I am trying to change the "date last opened" attribute for several files and folders on El Capitan. The old technique of using "touch -mt " doesn't seem to work. Sometimes it works in very rare cases but for most of my files the command terminates with no errors and no effect on the "date last opened" attribute. It does seem to change the "date modified" attribute. Any ideas?

0

1 Answer 1

0

I believe the following should work, I could not confirm it, yet:

The last opened date is stored in the metadata kMDItemLastUsedDate property. You can check it using the mdls <file> command.

To modify the value use the following syntax:

xattr -w "com.apple.metadata:kMDItemLastUsedDate" "<date>" <file>
1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .