Skip to content

Instantly share code, notes, and snippets.

@otkrsk
Last active February 20, 2020 01:16
Show Gist options
  • Save otkrsk/6d2405590a6d8170d582382b0ee9db27 to your computer and use it in GitHub Desktop.
Save otkrsk/6d2405590a6d8170d582382b0ee9db27 to your computer and use it in GitHub Desktop.
Insert a Date Time Stamp Into a File and Append a Date Time Stamp to a Filename (in MacOS).
# insert the date into the file
date "+ %Y-%m-%d %H:%M:%S %z" >> filename.fileext
# append the date into the file
mv filename.fileext $(date +"%Y-%m-%d")_filename.fileext
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment