Tips & Tricks: cp with forced overwrite

I was recently trying to copy a directory over an existing one and kept getting prompted if I wanted to overwrite existing files even though I was using the force option.

@her###:~$ sudo cp -Rf dir1 dir2

Quick solution is to bypass the alias that initially forces the cp command into interactive mode with a backslash which references cp.

@her###:~$ sudo \cp -Rf dir1 dir2

No comments:

Post a Comment