In UNIX, which single command creates the directory "PIS" together with its two subdirectories "progs" and "data" (i.e. PIS/progs and PIS/data), all newly created in one invocation?
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: C. mkdir PIS PIS/progs PIS/data
Explanation
Without the -p flag,mkdir processes its arguments left to right and fails on any path whose parent directory does not yet exist. Option (iii), mkdir PIS PIS/progs PIS/data, lists PIS first, so by the time the command reaches PIS/progs and PIS/data their parent PIS has already been created in that same invocation, so all three succeed. Option (i) tries to create PIS/progs and PIS/data before PIS exists and fails; option (ii) creates three unrelated top-level directories (PIS, progs, data) instead of nesting them inside PIS; option (iv) only creates one subdirectory path plus a stray top-level "data". Hence option (iii). More Software Engineering questions
- Match List I with List II
- Which of the followings is NOT a software characteristic?
- Which of the following cohesions are better than the Procedural Cohesion A. Functional Cohesion B. Sequential Cohesion C. Temporal Cohesion…
- Which of the followings belongs to MaCall's quality factors? A. Maintainability B. Usability C. Integrity D. Functionality
- Match List I with List II
- In Software Engineering Jackson's Principle based on A. Designation B. Definitions C. Refutable Assertions D. Formal Review E. Requirement…