Skip to content

Instantly share code, notes, and snippets.

@adrienjoly
Created July 7, 2018 15:09
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 adrienjoly/28c3fc268e522e168dd16715488cb0e0 to your computer and use it in GitHub Desktop.
Save adrienjoly/28c3fc268e522e168dd16715488cb0e0 to your computer and use it in GitHub Desktop.
bash/shell command to generate a timestamp — handy to prefix backup and archive file names, so that they are sorted by date
TIMESTAMP="$(date +'%Y-%m-%d_%H-%M')"
# => e.g. TIMESTAMP="2018-05-26_09-20"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment