Skip to content

Instantly share code, notes, and snippets.

@pwenzel
Created May 19, 2011 20:03
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 pwenzel/981604 to your computer and use it in GitHub Desktop.
Save pwenzel/981604 to your computer and use it in GitHub Desktop.
Examples of Date In Shell Script
# backup_060403.tar.gz
tar -czf backup_$(date +%y%m%d).tar.gz
# test_20110519-150054.jpg
mv example.jpg test_$(date +%Y%m%d-%H%M%S).jpg
# test_1305835327.jpg (timestamp)
mv example.jpg test_$(date +%Y%m%d-%H%M%S).jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment