Skip to content

Instantly share code, notes, and snippets.

@LongYC
Last active June 13, 2018 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LongYC/f19f5496bbc949569498 to your computer and use it in GitHub Desktop.
Save LongYC/f19f5496bbc949569498 to your computer and use it in GitHub Desktop.
Change the creation and modification date of a file.
# chmod 755 changedate.sh
# ./changedate.sh my_edited_photo.jpg 201504010000
# $1 = filename.
# $2 = date in YYYYMMDDhhmm.
echo "Changing the creation date of file: $1 to date: $2"
touch -t $2 $1 .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment