Bird
0
0

You want to create a project folder structure with src, bin, and docs inside myproject in one command. Which command achieves this?

hard📝 Application Q15 of 15
Linux CLI - File and Directory Operations
You want to create a project folder structure with src, bin, and docs inside myproject in one command. Which command achieves this?
Amkdir -p myproject/src myproject/bin myproject/docs
Bmkdir myproject && mkdir src bin docs
Cmkdir -p myproject/src/bin/docs
Dmkdir myproject/src myproject/bin myproject/docs
Step-by-Step Solution
Solution:
  1. Step 1: Understand nested folder creation

    Using -p allows creating parent directories and nested folders in one command without errors.
  2. Step 2: Analyze each option

    mkdir myproject/src myproject/bin myproject/docs lacks -p so may fail if myproject doesn't exist. mkdir -p myproject/src myproject/bin myproject/docs correctly uses -p to create all paths. mkdir -p myproject/src/bin/docs creates nested folders incorrectly. mkdir myproject && mkdir src bin docs creates folders separately, not in one command.
  3. Final Answer:

    mkdir -p myproject/src myproject/bin myproject/docs -> Option A
  4. Quick Check:

    Use mkdir -p with full paths for multiple nested folders [OK]
Quick Trick: Use mkdir -p with all paths to create nested folders at once [OK]
Common Mistakes:
MISTAKES
  • Omitting -p when parent folder doesn't exist
  • Creating nested folders incorrectly as one path
  • Running multiple mkdir commands instead of one

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes