Created
October 29, 2012 11:41
-
-
Save gaby-mg/3973112 to your computer and use it in GitHub Desktop.
Bash: copy file, appending date and time
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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