How does rsync differ with scp in terms of transfer speed, maximum transfer size etc ? Or they very similar ? And in what type of scenarios do we need to use these commands ?
There are two main differences (that I can think of) between rsync and scp.
Before a file is transferred rsync takes the checksums of the file (MD5 and adler-32 I believe) and sends them to the receiver. After a file is transferred the receiver verifies the data integrity using those checksums. scp does not have such mechanism. scp uses ssh to transfer the data and although ssh uses checksums on the packet level that's a different story (I believe the default rsync behaviour is also to use ssh for transfers).
Another difference is what happens during a transfer retry. While scp will ignore any partially transferred set of files and overwrite them on the receiving end, rsync is more clever than that. Rsync will check the destination for any files present and if their signature matches that of the files on the sender side it will not retransmit these files. It might be possible to overwrite this behaviour but I am not entirely sure.
scp(secure copy): copy the files one computer to another (or) local computer.
ex: scp 10.113.16.1:/source_file 22.214.171.124:/destination_file.
-> but scp is overriting files agin and again.
example:i have files(f1,f2,f3,f4) on source_file directory.again i copy file on
same destination(scp 10.113.16.1:/source_file
126.96.36.199:/destination_file) destination_file is(f1,f1,f2,f2,f3,f3,f4,f4) overriring. but rsync is skip the files already copied files. ex: rsync 10.113.16.1:/source_file 188.8.131.52:/destination_file.(first time) o/p:destination_file(f1,f2,f3,f4) ex: rsync 10.113.16.1:/source_file 184.108.40.206:/destination_file.(second time) o/p:destination_file(f1,f2,f3,f4).not override in this command