Bird
0
0

Which of the following is the correct syntax to copy a local file data.txt to a remote server server.com under user bob in the home directory?

easy📝 Syntax Q3 of 15
Linux CLI - SSH and Remote Access
Which of the following is the correct syntax to copy a local file data.txt to a remote server server.com under user bob in the home directory?
Ascp bob@server.com:~/ data.txt
Bscp data.txt bob@server.com:~/
Cscp data.txt server.com@bob:~/
Dscp -r data.txt bob@server.com
Step-by-Step Solution
Solution:
  1. Step 1: Understand scp syntax

    The syntax is scp source destination. To copy local to remote, source is local file, destination is user@host:path.
  2. Step 2: Check options

    scp data.txt bob@server.com:~/ correctly uses scp data.txt bob@server.com:~/. scp bob@server.com:~/ data.txt reverses source and destination. scp data.txt server.com@bob:~/ swaps user and host. scp -r data.txt bob@server.com uses -r unnecessarily for a file.
  3. Final Answer:

    scp data.txt bob@server.com:~/ -> Option B
  4. Quick Check:

    Local to remote copy syntax = scp file user@host:path [OK]
Quick Trick: Source first, then user@host:path for destination [OK]
Common Mistakes:
  • Swapping source and destination
  • Mixing user and host order
  • Using -r for single files

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes