more - Control the Text Displayed at Once

Maintained on
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.

- □ ×
Command Prompt Icon
Command Prompt
Microsoft Windows [Version xx.x.xxxxx.xxx]
(c) 2026 Ribbit App Development All rights reserved.
 
C:\users\user>tree
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.

- □ ×
Command Prompt Icon
Command Prompt
Microsoft Windows [Version xx.x.xxxxx.xxx]
(c) 2026 Ribbit App Development All rights reserved.
 
C:\users\user>tree | more
C:.
├───Documents
│   ├───Projects
│   │   ├───ProjectA
│   │   │   ├───Drafts
│   │   │   │   └───draft1.txt
│   │   │   ├───Final
│   │   │   │   ├───final_report.docx
-- More --
おすすめ書籍※ 広告を含む場合があります
中小企業経営者のためのRPA入門 RPA導入を成功させる方法

中小企業経営者のためのRPA入門 RPA導入を成功させる方法

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

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

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

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

知識・才能ゼロでもらく~に月10万円稼ぐ! よくわかる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.

KeyAction
SpaceShow the next page
EnterShow the next line
qQuit more (Ctrl + C also interrupts it)
=Show the current line number
p + numberShow the next n lines
s + numberSkip the next n lines
fShow 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

  • more shows long output or text files one screen at a time, as in dir | more or more < file.txt
  • Space advances one page, Enter one line, and q quits
  • Options such as +n, /c, /s and /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

Practice Problems

Practice 1

Which of the following correctly describes the behavior when the following command is executed?

more +5 example.txt
Practice 2

Which command displays the output of the dir command one page at a time?

#Command Prompt #Batch Files #Commands #more #Pipe #Paging