Bird
0
0

What will be the output or result of this command?

medium📝 Command Output Q13 of 15
Linux CLI - SSH and Remote Access
What will be the output or result of this command?
scp -r alice@server.com:/var/logs ./backup_logs
Assuming you have access and the remote directory exists.
ACopies the remote /var/logs directory recursively to local ./backup_logs folder
BCopies only files inside /var/logs but not subdirectories
CThrows an error because -r cannot be used with remote paths
DDeletes the local ./backup_logs directory
Step-by-Step Solution
Solution:
  1. Step 1: Understand the -r option in scp

    The -r flag means recursive copy, so it copies directories and their contents.
  2. Step 2: Analyze the command effect

    The command copies the remote directory /var/logs from user alice on server.com to the local folder ./backup_logs. This is valid and copies all files and subfolders.
  3. Final Answer:

    Copies the remote /var/logs directory recursively to local ./backup_logs folder -> Option A
  4. Quick Check:

    scp -r remote:/path local copies folders recursively [OK]
Quick Trick: Use -r to copy folders recursively from remote [OK]
Common Mistakes:
  • Thinking -r only copies files, not folders
  • Believing -r is invalid with remote paths
  • Confusing copy direction

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes