Can I make scp ask before overwriting an existing file?

Is there a possibility (man scp didn't reveal any) to make scp interactive like cp -i? That is, scp asks, if the target exists, if it may overwrite it?

If yes, does it work locally and remote?

If no: Let's alias it! But I hope for a simpler solution.


No. It was intended to operate as a direct, but secure, replacement for rcp and the -i option wasn't something rcp had, so it isn't found in vanilla scp.

You might prefer to use the Secure File Transfer Protocol (SFTP) via the sftp command instead. It supersedes scp and offers an interactive mode (though not quite what you're asking for with the -i request).