Viewing directory trees with paging: Which DOS command displays the subdirectory structure of the current drive and pauses after each screenful of output?

Difficulty: Easy

Correct Answer: TREE | MORE

Explanation:


Introduction / Context:
On DOS systems, long outputs scroll past the screen quickly. Piping commands through the MORE filter makes them readable page by page. Understanding how to combine commands increases efficiency at the command line.



Given Data / Assumptions:

  • TREE prints a graphical view of folders (subdirectories).
  • MORE pauses output after each screenful, waiting for a key.
  • The question asks specifically for showing the tree and pausing after each screen.


Concept / Approach:

Use a pipeline to send the output of TREE to MORE. This retains TREE’s hierarchical display while benefiting from paging. The syntax is straightforward and works with many commands that produce long output.



Step-by-Step Solution:

Generate subdirectory listing: TREE.Add pagination: pipe via | to MORE.Final command: TREE | MORE.Press a key to advance each page until output completes.


Verification / Alternative check:

Running TREE alone demonstrates scrolling. Running TREE | MORE clearly paginates the output, matching the problem’s requirement.



Why Other Options Are Wrong:

  • TREE: Shows the tree but does not pause.
  • DELTREE /F: Deletes directories; dangerous and unrelated.
  • DIR | MORE: Paginates file listings, not the hierarchical tree.
  • None of the above: Incorrect because TREE | MORE is valid.


Common Pitfalls:

Accidentally using DELTREE instead of TREE (which can delete folders). Also, forgetting that MORE paginates any standard output, not only DIR output.



Final Answer:

TREE | MORE

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion