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
-
Display a File:
Display the content ofexample.txt
one screen at a time.MORE example.txt
-
Pipe from a Command:
View output of a directory listing one page at a time.DIR | MORE
-
Starting from a Specific Line:
Start displaying from line 100 in a file.MORE +100 example.txt
-
Skip Multiple Blank Lines:
Displaylogfile.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
orFINDSTR
: 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
Related Commands
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.