3 ms·
I think that's a failure on SCP side. It should have never allowed scp -r dir target_dir with non-existent target_dir in the first place.
by lostmsu 5y ago
I think that's a failure on SCP side. It should have never allowed scp -r dir target_dir with non-existent target_dir in the first place.
- mhalle 5y agoI get what you are saying: cp/scp should have consistent behavior when the second arg is a directory. The "problem" operation you describe is analogous to copying plain files, though (copying contents to a new name). I don't think having to create a target directory first is obvious, although neither is the fact that bare "cp" doesn't copy directories. Finally, for remote copying it would be a nightmare for scp to require the destination directory to exist. To copy a directory tree to a remote server with a new name you'd need to either ssh a remote mkdir command, or add a flag to scp to specify the new name.