Which Command Transfers accounts.pdf to a Remote /tmp Directory?
Short answer
B scp accounts.pdf [email protected]:/tmp
Question
Key Takeaways
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.
Common mistake: 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.
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
- https://man7.org/linux/man-pages/man1/scp.1.html
- https://man7.org/linux/man-pages/man1/rsync.1.html
- https://man7.org/linux/man-pages/man1/ssh.1.html
These links open the official vendor documentation in a new tab.
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.
Community Votes
67% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 3 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 3
-
Mistermiyagi 👍 2 Answered BThe reason it's B is because the SCP command is correctly syntax'd Both A and B are viable options but the Rsync choice should be rsync accounts.pdf [email protected]:/tmp But, since it isn't, SCP takes the lead here with correct syntax and also does the job of securely copying accounts.pdf over to the 10.10.10.80:/tmp directory.
-
Eikan 👍 1 Answered ASending files to a remote host requires a (remote)sync command. What Is rsync? rsync is a powerful and versatile Linux command for transferring and synchronizing files between local and remote devices. Unlike traditional copy commands, rsync uses a delta-transfer algorithm to only transmit the differences between the source and destination files.
-
bongobo 👍 1all IPs are spelled incorrect: I0 instead 10
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.