Colton Peltier wrote: > While working with some coworkers recently we noticed a strange > inconsistency between cp and scp, that caused us some confusion. For > the cp tool a -r or -R will do a recursive copy of directories, but > for scp only -r will. The -R flag for scp is gives illegal > option. What is the reasoning behind this?
You are comparing 'cp' and 'scp' but those are apples and oranges. The 'scp' command is designed to be compatible with the 'rcp' command. The rcp command is one of the BSD 'r'commands. The rcp command uses the -r option. That is why scp uses it. http://www.freebsd.org/cgi/man.cgi?query=rcp&manpath=2.10+BSD While rcp is insecure it was one of the standard ways to do a remote file copy between systems. The scp command is designed to be compatible with it and to replace it. Therefore you should not be comparing scp and cp. Those commands are unrelated. The cp command came from AT&T Unix. The scp command came from rcp. The rcp command came from BSD. A yet newer command for remote file copy is 'rsync'. It is the newest addition from the brilliance of Tridgell. Again the options are unrelated to cp or rcp/scp. The rcp command is insecure and should never be used where security is a concern. The scp command is secure but is an old command that is burdened by needing to remain backward compatible with the rcp command. I recommend that you use the rsync command in preference over the scp command. All of the commands 'cp', 'rcp'/'scp', and 'rsync' are uniquely written individual commands from different origins. None of them should be compared with the other! Feel free to argue that being a "melting pot" where many different commands from all over are all ported to the same system and used intermingled together is a bad thing but for me it is one of the strong points of the system. Note that the scp command is not part of GNU coreutils. This group can't do anything about it. If you want changes in it you would need to take them up with the OpenSSH folks. But I expect they will try to avoid feature creep and suggest that it remain as a compatibility command for rcp since rsync is already available. Bob
