MORE - CMD


Overview

The MORE command in Windows CMD is used primarily to display one page of output at a time. It can be applied to the outputs of other commands or to the content of files. This command is especially useful for reading through lengthy text files or extensive command outputs where screen space is limited.

Syntax

The basic syntax for the MORE command is as follows:

MORE [options] [file_name]
  • file_name: The name of the file whose content needs to be displayed. If omitted, MORE will read the standard input.

Options/Flags

MORE includes several options that enhance its functionality:

  • +<number>: Start displaying the file beginning at the line specified by <number>.
  • /P: Pauses after each screenful of information.
  • /E: Enables extended features.
  • /C: Clears the screen before displaying the page.
  • /S: Skips multiple blank lines.
  • /T<n>: Expands tabs to <n> spaces (default is 8).
  • /L<lines>: Uses the specified number of lines per screenful.

Examples

  1. Display a File:
    Display the content of example.txt one screen at a time.

    MORE example.txt
    
  2. Pipe from a Command:
    View output of a directory listing one page at a time.

    DIR | MORE
    
  3. Starting from a Specific Line:
    Start displaying from line 100 in a file.

    MORE +100 example.txt
    
  4. Skip Multiple Blank Lines:
    Display logfile.txt but skip multiple blank lines.

    MORE /S logfile.txt
    

Common Issues

  • File Not Found: Users may encounter an error if the file specified does not exist. Ensure the file path and name are correct.
  • Output Clipping: When used in scripts or batch files, output may sometimes clip. Ensure appropriate pause or screen management.

Integration

MORE can be combined effectively with other CMD commands to handle large outputs:

  • Combining with FIND or FINDSTR: Filter logs or files and then paginate them for easier reading.

    FINDSTR "error" large_log.txt | MORE
    
  • Using with SORT: Sort data before viewing.

    SORT file.txt | MORE
    
  • TYPE: Displays the contents of a text file.
  • DIR: Lists directory contents, which can then be piped into MORE.
  • FIND, FINDSTR: Search tools that can be used to filter output before using MORE.

Further resources and official documentation can be explored here.