How to keep original "date created" when copying via Terminal?

Solution 1:

There are many reasons why one would rather use RSync instead of cp. RSync's default version on MacOS is 2.6.9, which is more than 12 years old as of today, and has several known bugs, and this is one of them. Apple won't include the updated versions on the new releases of the Mac OSX because of GPL3-related stuff.

To address this issue:

  1. Install Homebrew in your Mac, if you don't have it already
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. Install the new version of rsync available on brew:
brew install rsync
  1. Verify that your rsync version is at least 3.1.3:
rsync --version
  1. Copy your files using the --times and --crtimes
rsync -times --crtimes /sourcedirectory /destinationdirectory

Solution 2:

On 10.10.4, using cp -p /path/to/source /path/to/destination the time created is preserved. More specifically, in Finder, date created and date modified are preserved, while date added will have the copy time.