Difficulty: Easy
Correct Answer: mkdir
Explanation:
Introduction / Context:
Creating directories is one of the first file-system skills in UNIX/Linux administration. The shell offers a dedicated utility to make new folders at any path, with optional creation of parent directories and permission control. Knowing the correct command, flags, and typical usage prevents errors and improves scripting reliability.
Given Data / Assumptions:
Concept / Approach:
The standard tool is mkdir (make directory). It creates one or more directories supplied as arguments. Important flags include -p to create missing parent directories, and -m mode to set permissions at creation. The command is portable across distributions and POSIX-compliant shells.
Step-by-Step Solution:
To create a single directory in the current path: mkdir reports.To create nested parents: mkdir -p projects/2025/q1.To set permissions immediately: mkdir -m 750 teamshare.Verify using ls -ld directory_name to confirm ownership and mode.
Verification / Alternative check:
Run ls after creation to see the new entry. If -p is used and the directory exists, mkdir -p does nothing and returns success, which is useful in idempotent scripts.
Why Other Options Are Wrong:
crdir (Option A) and cr (Option D) are not standard UNIX commands.md (Option B) is a DOS/Windows alias, not portable on UNIX/Linux systems.None of the above (Option E) is wrong because mkdir is correct.
Common Pitfalls:
Final Answer:
mkdir
Discussion & Comments