Quickly create a file backup
Replace filename (or suffix) accordingly:
cp filename{,.bak}
Written by Marc Hibbins
Related protips
2 Responses

slick. I created a function for this.
create a backup of a file
function bu() {
cp "$1"{,.bak}
}
call it like this $ bu filename
over 1 year ago
·

A much more elegant in Bash: mv file !#:$.bak
over 1 year ago
·
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#