Bird
0
0

Identify the error in this command:

medium📝 Debug Q7 of 15
Linux CLI - File and Directory Operations
Identify the error in this command:
mkdir -p /var/logs; /app
AIncorrect use of forward slash in directory names
BMissing space after -p option
CSemicolon splits commands; second part is separate, not directory
DThe -p option cannot be combined with multiple directories
Step-by-Step Solution
Solution:
  1. Step 1: Analyze command structure

    The semicolon separates commands; mkdir -p /var/logs runs first, then /app runs as a separate command causing error.
  2. Step 2: Check other options

    Spaces and slashes are correct. The -p option supports multiple directories.
  3. Final Answer:

    Semicolon splits commands; second part is separate, not directory -> Option C
  4. Quick Check:

    Semicolon splits commands, not directory list [OK]
Quick Trick: Use spaces, not semicolons, to list directories in mkdir [OK]
Common Mistakes:
  • Using semicolon instead of space
  • Misunderstanding -p option usage
  • Thinking slashes are wrong

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes