Skip to content

Instantly share code, notes, and snippets.

@jasonyost
Created September 27, 2014 01:12
Show Gist options
  • Save jasonyost/f12c21c62295a69e37ac to your computer and use it in GitHub Desktop.
Save jasonyost/f12c21c62295a69e37ac to your computer and use it in GitHub Desktop.
bash/zsh quick file backup and diff
#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