Batch processing command instruction more command _dos/bat

Source: Internet
Author: User
Tags clear screen

Help information:
Displays output on a per-screen basis.

Copy Code code as follows:

more [/e [/C] [/P] [/S] [/tn] [+n]] < [drive:][path]filename
Command-name | more [/e [/C] [/P] [/S] [/tn] [+n]]
more/e [/C] [/P] [/S] [/tn] [+n] [files]
[Drive:] [path]filename Specifies the file to be displayed on a per-screen basis.
COMMAND-NAME Specifies the command to display its output.
/e Enable extended functionality
/C Clear the screen before displaying the page
/P Extended FormFeed characters
/S indent multiple blank lines into one line
/TN expands tabs to n spaces (default is 8)
The switch can appear in the more environment variable.
+N displays the first file from the nth line
The file list to display for files. Use spaces to separate the files in the list.
If extended functionality is enabled, accept the following command at the-more-prompt:
P n shows down n rows
S n Skip down N line
F Display Next file
Q exit
= Show line number
? Show Help Lines
<space> Show Next Page
<ret> Show Next line

Command summary:

More, meaning "more", here can be extended to "in addition to these and ..."
/e,enable expansion, meaning "allow extension".
/c,clear, meaning "clear".
/p,expand, meaning "extended".
/s,squeeze, meaning "squeeze; crush." The word "squeeze" has been a very vivid illustration of the use of this parameter.
/t,tabs, meaning "tab".

Parameter detailed:

The more command is to display the contents of one screen at a time (one of the screens here is the screen of the cmd window, not the monitor).

1. Display the output of the specified command on a per-screen basis

The most commonly used situation is when displaying the IP address information.
For example:

Copy Code code as follows:

C:\users\helloworld\desktop>ipconfig/all |more

Results:

Copy Code code as follows:

Windows IP Configuration
Host name ............. : helloworld-pc
Primary DNS suffix ........... :
Node type ............: mixed
IP routing is enabled ..........: no
WINS Proxy is enabled ... . : No
PPP Adapter Broadband Connection:
Connection-specific DNS suffix ...:
Describe............... : Broadband Connection
Physical Address ............. :
DHCP enabled ........... : No
Automatic configuration Enabled ..........: is
IPV4 Address ............:110.206.18.142(preferred)
Subnet Mask ............:255.255.255.255
Default gateway ............. : 0.0.0.0
DNS Server ........... : 61.234.254.6
211.98.2.4
NetBIOS on the TCPIP ...: Disabled
Ethernet Adapter Local Area Connection:
--More--

2. Display the contents of the specified text on a per-screen basis

Content in 1.txt:
Displays output on a per-screen basis.

Copy Code code as follows:

more [/e [/C] [/P] [/S] [/tn] [+n]] < [drive:][path]filename
Command-name | more [/e [/C] [/P] [/S] [/tn] [+n]]
more/e [/C] [/P] [/S] [/tn] [+n] [files]
[Drive:] [path]filename Specifies the file to be displayed on a per-screen basis.
COMMAND-NAME Specifies the command to display its output.
/e Enable extended functionality
/C Clear the screen before displaying the page
/P Extended FormFeed characters
/S indent multiple blank lines into one line
/TN expands tabs to n spaces (default is 8)
The switch can appear in the more environment variable.
+N displays the first file from the nth line
The file list to display for files. Use spaces to separate the files in the list.
If extended functionality is enabled, accept the following command at the-more-prompt:
P n shows down n rows
S n Skip down N line
F Display Next file
Q exit
= Show line number
? Show Help Lines
<space> Show Next Page
<ret> Show Next line

There are two ways to do this.

①. Direct display.
Code:

Copy Code code as follows:

C:\users\hellow~1\desktop>more 1.txt

Effect:
Displays output on a per-screen basis.

Copy Code code as follows:

more [/e [/C] [/P] [/S] [/tn] [+n]] < [drive:][path]filename
Command-name | more [/e [/C] [/P] [/S] [/tn] [+n]]
more/e [/C] [/P] [/S] [/tn] [+n] [files]
[Drive:] [path]filename Specifies the file to be displayed on a per-screen basis.
COMMAND-NAME Specifies the command to display its output.
/e Enable extended functionality
/C Clear the screen before displaying the page
/P Extended FormFeed characters
/S indent multiple blank lines into one line
/TN expands tabs to n spaces (default is 8)
The switch can appear in the more environment variable.
+N displays the first file from the nth line
The file list to display for files. Use spaces to separate the files in the list.
If extended functionality is enabled, accept the following command at the-more-prompt:
P n shows down n rows
S n Skip down N line
F Display Next file
--More (88%)--

②. Display with a redirection character.
Code:

Copy Code code as follows:

C:\users\hellow~1\desktop>more<1.txt

Results:
Displays output on a per-screen basis.

Copy Code code as follows:

more [/e [/C] [/P] [/S] [/tn] [+n]] < [drive:][path]filename
Command-name | more [/e [/C] [/P] [/S] [/tn] [+n]]
more/e [/C] [/P] [/S] [/tn] [+n] [files]
[Drive:] [path]filename Specifies the file to be displayed on a per-screen basis.
COMMAND-NAME Specifies the command to display its output.
/e Enable extended functionality
/C Clear the screen before displaying the page
/P Extended FormFeed characters
/S indent multiple blank lines into one line
/TN expands tabs to n spaces (default is 8)
The switch can appear in the more environment variable.
+N displays the first file from the nth line
The file list to display for files. Use spaces to separate the files in the list.
If extended functionality is enabled, accept the following command at the-more-prompt:
P n shows down n rows
S n Skip down N line
F Display Next file
--More--

These two methods of displaying text, in addition to the different writing, in the visual sense, "direct display" will show the text has shown the percentage (-More (88%)-), and "redirect display" does not show the percentage (-more-).

3. Clear screen before display

Code:

Copy Code code as follows:

MORE/C 1.txt

Equivalent code:

Copy Code code as follows:

Cls
More 1.txt

Yes, the/C parameter is equivalent to adding a CLS command in front of the more command (in the prompt state it is not actually a CLS-plus, because the/C parameter also clears the echo of the more command itself).

4. Indent consecutive blank lines into one line

Code:

Copy Code code as follows:

MORE/S 1.txt

Key words: "Continuous"
Instead of eliminating blank lines, this parameter indents contiguous lines of white space and shrinks into a single line of white space. The difference between the two must be clear, otherwise it is easy to use the wrong order.

5. Change tab to a specified number of spaces

Code:

Copy Code code as follows:

More/t1 1.txt

A tab character is the symbol that is produced when the TAB key is pressed.

If you do not add the/t parameter, the TAB's style is displayed directly, plus the = = and the number of spaces is specified, and the specified spaces are displayed.

This parameter is not commonly used.

6. Skip the specified line

Jump over two lines.

Code:

Copy Code code as follows:

More +2 1.txt

Effect:

Copy Code code as follows:

more [/e [/C] [/P] [/S] [/tn] [+n]] < [drive:][path]filename
Command-name | more [/e [/C] [/P] [/S] [/tn] [+n]]
more/e [/C] [/P] [/S] [/tn] [+n] [files]

[Drive:] [path]filename Specifies the file to be displayed on a per-screen basis.

COMMAND-NAME Specifies the command to display its output.

/e Enable extended functionality
/C Clear the screen before displaying the page
/P Extended FormFeed characters
/S indent multiple blank lines into one line
/TN expands tabs to n spaces (default is 8)

The switch can appear in the more environment variable.
+N displays the first file from the nth line

The file list to display for files. Use spaces to separate the files in the list.
If extended functionality is enabled, accept the following command at the-more-prompt:
P n shows down n rows
S n Skip down N line
F Display Next file
Q exit
= Show line number
--More (92%)--

Skipped rows:
Displays output on a per-screen basis.
Blank line.

A blank line is a line.

7. The "Skip specified line" (+n) has precedence over the/s parameter.

We know that/s is to indent consecutive blank lines, so what if there are 5 lines in one text header (with 4 rows in a row), and I use +2 (skip two lines) and/a?

1.txt
Displays output on a per-screen basis.

Copy Code code as follows:

more [/e [/C] [/P] [/S] [/tn] [+n]] < [drive:][path]filename
Command-name | more [/e [/C] [/P] [/S] [/tn] [+n]]
more/e [/C] [/P] [/S] [/tn] [+n] [files]

Code:

Copy Code code as follows:

MORE/S +2 1.txt

Effect:

Copy Code code as follows:

[color=red] blank line. [/color]
more [/e [/C] [/P] [/S] [/tn] [+n]] < [drive:][path]filename
Command-name | more [/e [/C] [/P] [/S] [/tn] [+n]]
more/e [/C] [/P] [/S] [/tn] [+n] [files]

A 1-line blank line is displayed, stating that +2 runs before the/s parameter, because if the/T parameter runs first and skips 2 rows, the result will not have a blank line.

8. Display multiple files on a per-screen basis.

1.txt

Copy Code code as follows:

Hello

2.txt

Copy Code code as follows:

World

Code:

Copy Code code as follows:

More 1.txt 2.txt

Effect:

Copy Code code as follows:

Hello
World

9. Operation command when display is incomplete (percent complete is less than 100%) --General for command prompt

Copy Code code as follows:

P n shows the bottom n line (enter p first, then enter a 0-9 number)
S n skips down n rows (same p, but not shown but skipped)
F Displays the next file (for more commands to display multiple files)
Q exit
= Displays the line number of the last line currently displayed
? Show Help
The SPACEBAR displays the next page
The ENTER key displays the next line

The above mentioned is the entire content of this article, I hope you can enjoy.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.