← 返回命令列表

Linux command

more 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Open a file

more [path/to/file]

Start at a specific line

more +[line_number] [path/to/file]

Search for a string

more +/[pattern] [path/to/file]

Squeeze

more -s [path/to/file]

Example

more -n [20] [path/to/file]

说明

more is a filter for paging through text one screenful at a time. It displays file contents interactively, allowing forward navigation and searching through the text. Commands follow vi conventions and can be preceded by numeric arguments. The pager reads from files or standard input, making it useful in pipelines.

参数

-d, --silent
Prompt with "Press space to continue, 'q' to quit." instead of ringing bell on errors.
-l, --logical
Do not pause after lines containing form feed characters.
-e, --exit-on-eof
Exit automatically at end of file. Enabled by default if not on a terminal.
-f, --no-pause
Count logical lines rather than screen lines (long lines are not folded).
-p, --print-over
Clear screen before displaying; do not scroll.
-c, --clean-print
Paint each screen from top, clearing remainder of each line.
-s, --squeeze
Compress multiple consecutive blank lines into one.
-u, --plain
Suppress underlining.
-n _number_, --lines _number_
Specify number of lines per screenful.
-_number_
Equivalent to --lines _number_.
+_number_
Start display at specified line number.
+/_pattern_
Search for pattern before displaying.
-h, --help
Display help text and exit.
-V, --version
Print version information and exit.

FAQ

What is the more command used for?

more is a filter for paging through text one screenful at a time. It displays file contents interactively, allowing forward navigation and searching through the text. Commands follow vi conventions and can be preceded by numeric arguments. The pager reads from files or standard input, making it useful in pipelines.

How do I run a basic more example?

Run `more [path/to/file]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -d, --silent do in more?

Prompt with "Press space to continue, 'q' to quit." instead of ringing bell on errors.