In MS-DOS, which command sequence displays the contents of a text file one screen at a time, pausing after each screenful?

Difficulty: Easy

Correct Answer: TYPE filename | MORE

Explanation:


Introduction / Context:
MS-DOS lacks a native paging viewer like UNIX's less, so technicians often combine built-in commands to examine long text files without flooding the screen. Understanding the standard pipeline for paging is important during troubleshooting and reviewing logs or configuration files in DOS environments.


Given Data / Assumptions:

  • The goal is to view a file with pagination.
  • We are restricted to stock DOS commands.
  • UNIX commands (e.g., cat, pg) are not present in plain DOS.


Concept / Approach:

TYPE outputs the contents of a file to standard output. MORE paginates text by pausing after each screenful. Piping the output of TYPE into MORE (TYPE filename | MORE) achieves page-by-page viewing. The options using CAT and pg are UNIX-style and not valid in DOS, and MORE filename alone does not read the file in MS-DOS; it expects input from STDIN or a pipe.


Step-by-Step Solution:

Choose a command to emit file contents: TYPE.Choose a command to paginate output: MORE.Combine using a pipe: TYPE filename | MORE.Verify that this pauses after each screenful and continues on keypress.


Verification / Alternative check:

Running TYPE CONFIG.SYS | MORE on a DOS machine demonstrates pagination, confirming the correct usage pattern.


Why Other Options Are Wrong:

  • CAT filename | MORE: CAT is not a DOS command.
  • CAT filename | pg: both components are UNIX utilities.
  • MORE filename: in DOS 6.x, MORE does not accept a filename parameter; it paginates piped input.
  • None of the above: incorrect because a valid DOS pipeline exists.


Common Pitfalls:

  • Attempting to run UNIX pipelines verbatim in DOS.
  • Forgetting to use the pipe so MORE has input to paginate.


Final Answer:

TYPE filename | MORE.

Discussion & Comments

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