← 返回命令列表

Linux command

pg 命令

文件

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

常用示例

View

pg [path/to/file]

Example

pg -h

说明

pg displays text files one page at a time, similar to more and less. It allows backward and forward navigation through files and supports searching within the displayed content. The pager accepts various commands at its prompt: pressing Enter advances one line, space advances one page, and search patterns can be entered with slash notation.

参数

-_number_
Number of lines per page
-c
Clear screen before displaying each page
-e
Do not pause at end of file
-f
Do not split long lines
-n
Accept commands without newline
-p _string_
Use string as the prompt
-r
Allow restricted shell escape
-s
Display messages in standout mode

FAQ

What is the pg command used for?

pg displays text files one page at a time, similar to more and less. It allows backward and forward navigation through files and supports searching within the displayed content. The pager accepts various commands at its prompt: pressing Enter advances one line, space advances one page, and search patterns can be entered with slash notation.

How do I run a basic pg example?

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

What does -_number_ do in pg?

Number of lines per page