Multiple choice technology operating systems

Which command is used to create recursive directories.

  1. mkdir -p x/y x/y/z

  2. mkdir -r x/y x/y/z

  3. mkdir x x/y x/y/z

  4. mkdir -x x/y x/y/z

Reveal answer Fill a bubble to check yourself
A,C Correct answer
Explanation

The mkdir -p flag creates parent directories as needed, including intermediate directories. Option A is the standard way to create recursive directories. Option C works by explicitly creating each level but is not the proper recursive approach.