Created
September 27, 2014 01:12
-
-
Save jasonyost/f12c21c62295a69e37ac to your computer and use it in GitHub Desktop.
bash/zsh quick file backup and diff
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
#Make a quick backup of a file before changing it: | |
cp /path/to/your-file{,.bak} | |
#Make some changes, then compare the newly-edited file and its backup: | |
diff /path/to/your-file{.bak,} | |
#Undo changes: | |
cp /path/to/your-file{.bak,} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment