Skip to content

Instantly share code, notes, and snippets.

@gaby-mg
Created October 29, 2012 11:41
Show Gist options
  • Save gaby-mg/3973112 to your computer and use it in GitHub Desktop.
Save gaby-mg/3973112 to your computer and use it in GitHub Desktop.
Bash: copy file, appending date and time
#!/bin/bash
# This will copy a file, appending the date and time
# to the end of the file name.
date_formatted=$(date +%m_%d_%y-%H.%M.%S)
cp -iv $1 $2.$date_formatted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment