more - Control the Text Displayed at Once
Table of Contents
When using commands like dir or tree, if the target directory contains a large number of files or folders, the amount of text displayed at once can be overwhelming and may exceed the screen’s viewable area.
For example, if you run the tree command on a directory with a large hierarchy, it can be difficult to see the entire output as it may exceed the screen’s viewable area.
C:.
├───Documents
│ ├───Projects
│ │ ├───ProjectA
│ │ │ ├───Drafts
│ │ │ │ └───draft1.txt
│ │ │ └───Final
│ │ │ └───final_report.docx
│ │ └───ProjectB
│ └───Reports
│ ├───2021
│ └───2022
├───Downloads
└───Music
... (hundreds more lines follow) In such cases, you can use the more command to display the content one page at a time.
C:.
├───Documents
│ ├───Projects
│ │ ├───ProjectA
│ │ │ ├───Drafts
│ │ │ │ └───draft1.txt
│ │ │ ├───Final
│ │ │ │ ├───final_report.docx
-- More -- 
中小企業経営者のためのRPA入門 RPA導入を成功させる方法

60分でわかる! AIエージェント 超入門

コマンドラインの黒い画面が怖いんです。

知識・才能ゼロでもらく~に月10万円稼ぐ! よくわかるAI副業超入門
This article explains the basic usage of the more command, its options, and the keys you can use while paging.
What is the more command?
The more command displays the contents of a text file or the output of another command one screen at a time. It is an external command provided as C:\Windows\System32\more.com, so no extra installation is needed. It is useful when the text does not fit on one screen and you want to read it without it scrolling past.
more accepts a file name directly, input redirection such as more < file.txt, and pipes such as dir | more.
Basic usage of the more command
Basic syntax
more [options] [filename]
Example
To display the contents of example.txt, enter the following command:
more example.txt
The contents are displayed one page at a time. Press the Space bar to move to the next page, or Enter to advance one line.
Options for the more command
+n option
Starts displaying from line n of the file.
more +20 example.txt
In this case, the display starts from line 20.
/c option
Clears the screen before displaying each new page.
/s option
Collapses consecutive blank lines into a single line.
type server.log | more /c /s
/p option
Expands form feed characters. It is rarely needed for ordinary text files.
/t<n> option
Replaces tab characters with n spaces. If n is omitted, 8 is used. Do not put a space between /t and the number.
more /t4 example.txt
Using with pipes
You can also combine more with commands such as dir or type.
dir | more
The contents of the directory are displayed one page at a time.
Keys available at the -- More -- prompt
While -- More -- is displayed, you can use the following keys.
| Key | Action |
|---|---|
Space | Show the next page |
Enter | Show the next line |
q | Quit more (Ctrl + C also interrupts it) |
= | Show the current line number |
p + number | Show the next n lines |
s + number | Skip the next n lines |
f | Show the next file (when several files are specified) |
? | Show help |
Going back to a previous page
more can only move forward; you cannot return to text that has already been shown. If you want to read back and forth, you can:
- Use the scroll bar of the Command Prompt window itself
- Save the output to a file and open it in Notepad (for example,
dir > result.txt) - In PowerShell, page the output with
Get-Content example.txt | Out-Host -Paging
If you only want to find a specific string in a large amount of output, filtering with the findstr command is more efficient than paging.
Examples of using the more command
Checking log files
more server.log
Viewing long text files
more novel.txt
Summary
moreshows long output or text files one screen at a time, as indir | moreormore < file.txtSpaceadvances one page,Enterone line, andqquits- Options such as
+n,/c,/sand/t<n>change the start line and how blank lines and tabs are shown - You cannot go back to a previous page; use a saved file or the window scroll bar instead