A zsh alias to quickly back up a file
Hey!
There's places where you wish you had version control, but there is none. You feel that a classical backup makes more sense, but it takes a bit of time to type and remember how to do it! (Actually, it doesn't, but it makes the tip sound at least remotely useful)
Here's a small alias I recently added to my zshrc:
bkp() {
cp "$1"{,.bak}
}
So now you can use it by typing bkp test.txt
and it will create a file named test.txt.bak
in the current directory.
And that's something one can easily add to their toolbox.
Written by Ivan Zarea
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#