1 .\" Copyright 2001 Gunnar Ritter
2 .TH PG 1 "July 2014" "util-linux" "User Commands"
4 pg \- browse pagewise through text files
12 .RB [ +/\fIpattern\fP/ ]
16 displays a text file on a
18 one screenful at once.
19 After each page, a prompt is displayed. The user may then either press the
20 newline key to view the next page or one of the keys described below.
22 If no filename is given on the command line,
24 reads from standard input.
25 If standard output is not a terminal,
29 but precedes each file with its name if there is more than one.
31 If input comes from a pipe,
33 stores the data in a buffer file while reading,
34 to make navigation possible.
37 accepts the following options:
40 Start at the given line number.
43 Start at the line containing the Basic Regular Expression
48 The number of lines per page. By default, this is the number of
53 Clear the screen before a page is displayed,
54 if the terminfo entry for the terminal provides this capability.
57 Do not pause and display
62 Do not split long lines.
65 Without this option, commands must be terminated by a newline character.
68 advances once a command letter is entered.
71 Instead of the normal prompt
79 its first occurrence is replaced by the number of the current page.
82 Disallow the shell escape.
88 if the terminfo entry for the terminal provides this capability.
90 .BR \-V , " \-\-version"
91 Display version information and exit.
94 Display help text and exit.
96 The following commands may be entered at the prompt. Commands preceded by
98 in this document accept a number as argument, positive or negative.
99 If this argument starts with
103 it is interpreted relative to the current position in the input file,
104 otherwise relative to the beginning.
107 Display the next or the indicated page.
109 \fIi\fR\fBd\fR or \fB^D\fR
110 Display the next halfpage. If
112 is given, it is always interpreted relative to the current position.
115 Display the next or the indicated line.
120 must be a positive number and is always interpreted relative
121 to the current position.
123 \fIi\fR\fBw\fR or \fIi\fR\fBz\fR
128 becomes the new page size.
134 Advance to the last line of the input file.
137 Search forward until the first or the \fIi\fR-th
138 occurrence of the Basic Regular Expression
140 is found. The search starts
141 after the current page and stops at the end of the file.
142 No wrap-around is performed.
144 must be a positive number.
146 \fIi\fR\fB?\fR\fIpattern\fR\fB?\fR or \fIi\fR\fB^\fR\fIpattern\fR\fB^\fR
147 Search backward until the first or the \fIi\fR-th
148 occurrence of the Basic Regular Expression
150 is found. The search starts
151 before the current page and stops at the beginning of the file.
152 No wrap-around is performed.
154 must be a positive number.
156 The search commands accept an added letter. If
158 is given, the line containing the pattern is displayed at the top of the
159 screen, which is the default.
161 selects the middle and
163 the bottom of the screen.
164 The selected position is used in following searches, too.
167 Advance to the next file or
172 Reread the previous file or
177 Save the current file to the given
181 Display a command summary.
191 If the user presses the interrupt or quit key while
194 input file or writes on the terminal,
196 will immediately display the prompt.
197 In all other situations these keys will terminate
199 .SH "ENVIRONMENT VARIABLES"
200 The following environment variables
201 affect the behavior of
205 Overrides the system-supplied number of columns if set.
207 .BR LANG ,\ LC_ALL ,\ LC_COLLATE ,\ LC_CTYPE ,\ LC_MESSAGES
212 Overrides the system-supplied number of lines if set.
219 Determines the terminal type.
230 expects the terminal tabulators to be set every eight positions.
234 characters cannot be displayed by
237 The pg command is part of the util-linux package and is available from
238 https://www.kernel.org/pub/linux/utils/util-linux/.