Bird
0
0

What does the -p option do when used with the mkdir command?

easy📝 Conceptual Q1 of 15
Linux CLI - File and Directory Operations
What does the -p option do when used with the mkdir command?
ADeletes existing directories before creating new ones
BPrints the directory path after creation
CCreates parent directories as needed without error if they exist
DPrompts before creating each directory
Step-by-Step Solution
Solution:
  1. Step 1: Understand the -p option

    The -p option allows mkdir to create parent directories if they do not exist, avoiding errors.
  2. Step 2: Compare other options

    Other options do not match the behavior of -p. It does not print paths, prompt, or delete directories.
  3. Final Answer:

    Creates parent directories as needed without error if they exist -> Option C
  4. Quick Check:

    -p option = Creates parents [OK]
Quick Trick: Use -p to create nested folders safely without errors [OK]
Common Mistakes:
  • Thinking -p prints directory names
  • Confusing -p with prompt option
  • Assuming -p deletes directories

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes