Bird
0
0

What will happen when you run this command?

medium📝 Command Output Q5 of 15
Linux CLI - File and Directory Operations
What will happen when you run this command?
mkdir -p /tmp/project/src
ACreates /tmp/project/src and any missing parent directories
BFails if /tmp/project does not exist
CCreates only /tmp/project directory
DDeletes /tmp/project/src if it exists
Step-by-Step Solution
Solution:
  1. Step 1: Understand -p option with nested paths

    The -p option creates all missing parent directories along the path.
  2. Step 2: Analyze other options

    It does not fail if parents are missing, nor deletes existing directories.
  3. Final Answer:

    Creates /tmp/project/src and any missing parent directories -> Option A
  4. Quick Check:

    mkdir -p creates all parents [OK]
Quick Trick: Use -p to create full nested directory paths [OK]
Common Mistakes:
MISTAKES
  • Thinking mkdir -p fails if parents missing
  • Assuming it deletes existing directories
  • Believing it creates only first directory

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes