Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ugultopu/252149e26e2408ec31df3252a5d5beab to your computer and use it in GitHub Desktop.
Save ugultopu/252149e26e2408ec31df3252a5d5beab to your computer and use it in GitHub Desktop.

Use the touch command like:

touch -t '1509260825' <path to the file>

This will set both the creation and modification date of the file to "2015-09-26 08.25".

To preserve the creation and modification dates when coping a file, use the -p option of the cp command like:

cp -p <path to the file> <destination path>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment