RHEL Linux - Red Hat System Administration Practice Exam

Disable ads (and more) with a membership for a one time $4.99 payment

Study for the RHEL Linux - Red Hat System Administration Exam. Enhance your knowledge with flashcards and multiple-choice questions, complete with hints and explanations. Prepare for your certification!

Practice this question and more.


If two files or directories are similar between two systems and you only wish to copy the differences between the systems, which command is the best to use in this situation?

  1. sftp

  2. scp

  3. rsync

  4. ftp

The correct answer is: rsync

The best command to use in this situation is rsync because it is specifically designed for efficiently synchronizing files and directories between two locations, whether on the same system or across different systems. Rsync compares the source and destination, identifying which parts of the files are different rather than transferring entire files. This is particularly beneficial because it minimizes data transfer by only copying the differences or changes, which can significantly reduce network usage and speed up the synchronization process, especially with large files or directories. Furthermore, rsync provides additional features such as compression during transfer, preserving file permissions, and the ability to resume interrupted transfers. This makes it a versatile and powerful tool for file synchronization tasks, which is essential in environments where you need to maintain consistency across multiple systems with minimal overhead. In contrast, the other options – sftp, scp, and ftp – do not inherently offer the ability to only copy differences. Sftp and ftp are focused on transferring files without the intelligence of checking for differences first, while scp reliably copies files but sends entire files regardless of whether they have changed. Thus, for your requirement of copying only the differences, rsync is the ideal choice.