Bird
0
0

Why does cp -r fail to copy symbolic links as links by default?

hard📝 Conceptual Q10 of 15
Linux CLI - File and Directory Operations
Why does cp -r fail to copy symbolic links as links by default?
ABecause -r does not support copying directories
BBecause -r copies the contents the links point to, not the links themselves
CBecause symbolic links cannot be copied in Linux
DBecause -r deletes the original links after copying
Step-by-Step Solution
Solution:
  1. Step 1: Understand symbolic link copying behavior

    cp -r copies the files/directories the links point to, not the links themselves.
  2. Step 2: Explain why this matters

    This means the copy is a real file, not a symbolic link. To copy links as links, -a or --preserve=links is needed.
  3. Final Answer:

    Because -r copies the contents the links point to, not the links themselves -> Option B
  4. Quick Check:

    Symbolic link copy behavior = -r copies targets [OK]
Quick Trick: Use -a to copy symbolic links as links [OK]
Common Mistakes:
  • Thinking -r copies links as links
  • Believing symbolic links can't be copied
  • Assuming -r deletes originals

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes