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?

  1. rsync [email protected]:/tmp accounts.pdf
  2. scp accounts.pdf [email protected]:/tmp Source Reference Answer
  3. cp [email protected]:/tmp accounts.pdf
  4. ssh accounts.pdf [email protected]:/tmp

Community Votes

B
67%
A
33%

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)

Mistermiyagi 👍 2 Selected: B
The 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 Selected: A
Sending 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 👍 1
all IPs are spelled incorrect: I0 instead 10

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

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.

Related Analysis

← Back to XK0-005 Study Guide