Last Updated: October 11, 2021
·
1.372K
· marchibbins

Quickly create a file backup

Replace filename (or suffix) accordingly:

cp filename{,.bak}

2 Responses
Add your response

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 ·