Which MS-DOS DIR option displays only file and directory names (bare format) without showing sizes, dates, or times?
-
ADIR/W
-
BDIR A:
-
CDIR/B
-
DDIR/S
-
ENone of the above
Answer
Correct Answer: DIR/B
Explanation
Introduction / Context:The DIR command is the primary tool for listing files in MS-DOS. It supports several switches to control formatting and recursion. For scripting and quick checks, technicians often need a concise “bare” list of names only, without extra metadata that clutters output or complicates parsing.
Given Data / Assumptions:
- The requirement is to display names only (no size, date, or time).
- Standard DOS 6.x syntax is assumed.
- We compare several common DIR switches.
Concept / Approach:
DIR /B produces “bare” listings—only names. DIR /W shows wide format but still includes header/footer information and is not as minimal as /B. DIR /S recurses into subdirectories, producing verbose output. DIR A: merely targets the A: drive and does not alter formatting. Thus, /B is the precise switch for name-only lists, useful in batch files and redirection to text files.
Step-by-Step Solution:
Identify the exact output requirement: names only.Map that requirement to known DIR switches: /B (bare).Exclude /W (wide but not bare), /S (recursive), and drive specifiers.Choose DIR/B.Verification / Alternative check:
Running DIR /B > list.txt creates a clean list of names suitable for scripts, demonstrating the intended behavior.
Why Other Options Are Wrong:
- DIR/W: omits details but still not “bare”; includes headings/columns.
- DIR A:: selects the A: drive; does not change format.
- DIR/S: verbose recursive listing.
- None of the above: incorrect because /B fits exactly.
Common Pitfalls:
- Confusing /W for minimal output—it is for columns, not bare mode.
- Forgetting that /B removes headers and summaries, ideal for batch processing.
Final Answer:
DIR/B.