Bird
0
0

Which command syntax correctly copies a directory and its contents to a backup folder?

easy📝 Syntax Q12 of 15
Linux CLI - System Administration
Which command syntax correctly copies a directory and its contents to a backup folder?
Acp -r /home/user/docs /backup/docs
Bcp /home/user/docs /backup/docs
Ccp -d /home/user/docs /backup/docs
Dcp -x /home/user/docs /backup/docs
Step-by-Step Solution
Solution:
  1. Step 1: Identify the correct option to copy directories recursively

    The -r option in cp copies directories and their contents recursively.
  2. Step 2: Check other options for correctness

    The plain cp lacks -r, so it won't copy directories properly. The options with -d and -x use invalid or unrelated flags.
  3. Final Answer:

    cp -r /home/user/docs /backup/docs -> Option A
  4. Quick Check:

    Copy directory = cp -r [OK]
Quick Trick: Use cp -r to copy folders with all files inside [OK]
Common Mistakes:
  • Forgetting the -r flag for directories
  • Using wrong flags like -d or -x
  • Assuming cp copies folders without options

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes