Bird
0
0

You run cp -r myfolder backup/ but get an error: cp: omitting directory 'myfolder'. What is the likely cause?

medium📝 Debug Q14 of 15
Linux CLI - File and Directory Operations
You run cp -r myfolder backup/ but get an error: cp: omitting directory 'myfolder'. What is the likely cause?
AYou used -r but the command was typed incorrectly
BThe destination folder 'backup/' does not exist
CYou forgot the -r option to copy directories
DYou ran <code>cp</code> without -r option on a directory
Step-by-Step Solution
Solution:
  1. Step 1: Understand the error message

    The error 'omitting directory' happens when cp tries to copy a directory without the recursive -r option.
  2. Step 2: Check the command given

    The question says you ran cp -r myfolder backup/ but error suggests -r was missing or command was different.
  3. Final Answer:

    You forgot the -r option to copy directories -> Option C
  4. Quick Check:

    Missing -r causes 'omitting directory' error [OK]
Quick Trick: Always use -r to copy directories [OK]
Common Mistakes:
  • Assuming destination folder missing causes this error
  • Typing -r incorrectly but not noticing
  • Ignoring error message meaning

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes