Which Command Transfers accounts.pdf to a Remote /tmp Directory?
A Linux administrator needs to transfer a local file named accounts.pdf to a remote /tmp directory of a server with the IP address 10.10.10.80. Which of the following commands needs to be executed to transfer this file?
Community Votes
67% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
This question tests your ability to recognize correct scp syntax and avoid confusing rsync's source/destination order; the trap is that rsync can copy files, but option A reverses the arguments and would pull remote files instead.
The correct command to transfer a local file to a remote server's /tmp directory is scp accounts.pdf [email protected]:/tmp. Community consensus selects B, but many mistakenly choose rsync without realizing its options reverse the source and destination order.
Option A (rsync [email protected]:/tmp accounts.pdf) is the most common wrong answer because rsync is a valid transfer tool, but the command as written places the remote server as the source and the local file as the destination, so it would download rather than upload.
Community Discussion (3 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
Option B, scp accounts.pdf [email protected]:/tmp, uses the standard secure copy syntax: scp [local-source] [user@host:remote-destination]. The local source file comes first, followed by the remote destination, which matches the requirement exactly. SCP also provides encrypted, secure transfer and is the expected utility for this task. The comment with 2 likes correctly points out that B has the proper syntax and fulfills the job of securely copying the file to the remote /tmp directory.
Why the Other Options Are Wrong
Option A uses rsync, which can transfer files, but the syntax is reversed. The correct rsync form would be rsync accounts.pdf [email protected]:/tmp. As written, option A would copy the remote /tmp directory to the local accounts.pdf file. Option C uses cp, which does not support remote paths unless the remote filesystem is mounted, and it incorrectly places the remote path first. Option D uses ssh with arguments that would be interpreted as a command to run on the remote host, not as a file transfer; it would fail or produce an error.
Community Comment Notes
One comment supporting B explains that both A and B are theoretically viable, but the rsync option as written is incorrect, giving SCP the victory. Another comment supporting A argues in favor of rsync's delta-transfer algorithm, but the comment overlooks the fact that the given rsync syntax is erroneous. A third comment clarifies that all IP addresses in the options contain a typographical error (using 'l0' instead of '10'), which is a red herring; candidates should focus on syntax rather than the exact display of the IP.
Official Reference
Exam Strategy
When answering file-transfer questions, verify the order of arguments: the source must come before the destination. For remote destinations, the syntax must include user@host:/path; remember that cp cannot handle remote paths and ssh does not copy files without additional redirection or commands.