From aa4f6daf771c465073747644582b82495a6853c8 Mon Sep 17 00:00:00 2001 From: Michihito Shigemura Date: Wed, 4 Oct 2017 23:47:33 +0900 Subject: [PATCH] Add cheatsheet for cp backup file with date --- cheat/cheatsheets/cp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cheat/cheatsheets/cp b/cheat/cheatsheets/cp index 3c0e246..5e84c64 100644 --- a/cheat/cheatsheets/cp +++ b/cheat/cheatsheets/cp @@ -6,3 +6,6 @@ cp -r ~/Desktop/cruise_pics/ ~/Pictures/ # Create a copy but ask to overwrite if the destination file already exists cp -i ~/Desktop/foo.txt ~/Documents/foo.txt + +# Create a backup file with date +cp foo.txt{,."$(date +%Y%m%d-%H%M%S)"} \ No newline at end of file