]>
Commit | Line | Data |
---|---|---|
3a60b1c2 | 1 | .\" Copyright 2001 Gunnar Ritter |
07990fdc | 2 | .TH PG 1 "July 2014" "util-linux" "User Commands" |
63cccae4 KZ |
3 | .SH NAME |
4 | pg \- browse pagewise through text files | |
5 | .SH SYNOPSIS | |
6 | .B pg | |
07990fdc | 7 | .RB [ \-\fIamount\fP ] |
30a07f7e | 8 | .RB [ \-p |
07990fdc | 9 | .IR prompt ] |
30a07f7e PB |
10 | .RB [ \-cefnrs ] |
11 | .RB [ +\fIline\fP ] | |
12 | .RB [ +/\fIpattern\fP/ ] | |
13 | .RI [ file ...] | |
63cccae4 | 14 | .SH DESCRIPTION |
232dc924 | 15 | .B pg |
63cccae4 KZ |
16 | displays a text file on a |
17 | .SM CRT | |
18 | one screenful at once. | |
b63f3814 | 19 | After each page, a prompt is displayed. The user may then either press the |
63cccae4 KZ |
20 | newline key to view the next page or one of the keys described below. |
21 | .PP | |
22 | If no filename is given on the command line, | |
b63f3814 | 23 | .B pg |
63cccae4 | 24 | reads from standard input. |
b63f3814 BS |
25 | If standard output is not a terminal, |
26 | .B pg | |
63cccae4 | 27 | acts like |
42632a90 | 28 | .BR cat (1) |
63cccae4 KZ |
29 | but precedes each file with its name if there is more than one. |
30 | .PP | |
31 | If input comes from a pipe, | |
b63f3814 | 32 | .B pg |
07990fdc | 33 | stores the data in a buffer file while reading, |
63cccae4 KZ |
34 | to make navigation possible. |
35 | .SH OPTIONS | |
b63f3814 | 36 | .B pg |
63cccae4 KZ |
37 | accepts the following options: |
38 | .TP | |
5bdc3754 | 39 | .BI + number |
07990fdc | 40 | Start at the given line number. |
5bdc3754 JA |
41 | .TP |
42 | .BI +/ pattern / | |
43 | Start at the line containing the Basic Regular Expression | |
44 | .I pattern | |
45 | given. | |
46 | .TP | |
63cccae4 | 47 | .BI \- number |
07990fdc | 48 | The number of lines per page. By default, this is the number of |
63cccae4 | 49 | .SM CRT |
b63f3814 | 50 | lines minus one. |
63cccae4 KZ |
51 | .TP |
52 | .B \-c | |
b63f3814 | 53 | Clear the screen before a page is displayed, |
63cccae4 KZ |
54 | if the terminfo entry for the terminal provides this capability. |
55 | .TP | |
56 | .B \-e | |
b63f3814 | 57 | Do not pause and display |
63cccae4 KZ |
58 | .SM (EOF) |
59 | at the end of a file. | |
60 | .TP | |
61 | .B \-f | |
b63f3814 | 62 | Do not split long lines. |
63cccae4 KZ |
63 | .TP |
64 | .B \-n | |
b63f3814 BS |
65 | Without this option, commands must be terminated by a newline character. |
66 | With this option, | |
67 | .B pg | |
63cccae4 KZ |
68 | advances once a command letter is entered. |
69 | .TP | |
70 | .BI \-p \ string | |
b63f3814 BS |
71 | Instead of the normal prompt |
72 | .IR : , | |
63cccae4 KZ |
73 | .I string |
74 | is displayed. | |
75 | If | |
76 | .I string | |
77 | contains | |
07990fdc | 78 | .BR %d , |
b63f3814 | 79 | its first occurrence is replaced by the number of the current page. |
63cccae4 KZ |
80 | .TP |
81 | .B \-r | |
82 | Disallow the shell escape. | |
83 | .TP | |
84 | .B \-s | |
85 | Print messages in | |
86 | .I standout | |
b63f3814 | 87 | mode, |
63cccae4 KZ |
88 | if the terminfo entry for the terminal provides this capability. |
89 | .TP | |
07990fdc | 90 | .BR \-V , " \-\-version" |
d35df4db | 91 | Display version information and exit. |
07990fdc BS |
92 | .TP |
93 | .BR \-h , " \-\-help" | |
94 | Display help text and exit. | |
95 | .SH COMMANDS | |
b63f3814 | 96 | The following commands may be entered at the prompt. Commands preceded by |
63cccae4 KZ |
97 | .I i |
98 | in this document accept a number as argument, positive or negative. | |
99 | If this argument starts with | |
07990fdc | 100 | .B + |
63cccae4 | 101 | or |
07990fdc | 102 | .BR \- , |
63cccae4 KZ |
103 | it is interpreted relative to the current position in the input file, |
104 | otherwise relative to the beginning. | |
105 | .TP | |
07990fdc | 106 | .IB i <Enter> |
63cccae4 KZ |
107 | Display the next or the indicated page. |
108 | .TP | |
109 | \fIi\fR\fBd\fR or \fB^D\fR | |
b63f3814 | 110 | Display the next halfpage. If |
63cccae4 KZ |
111 | .I i |
112 | is given, it is always interpreted relative to the current position. | |
113 | .TP | |
114 | .IB i l | |
115 | Display the next or the indicated line. | |
116 | .TP | |
117 | .IB i f | |
118 | Skip a page forward. | |
119 | .I i | |
120 | must be a positive number and is always interpreted relative | |
121 | to the current position. | |
122 | .TP | |
123 | \fIi\fR\fBw\fR or \fIi\fR\fBz\fR | |
07990fdc BS |
124 | As |
125 | .B <Enter> | |
30a07f7e | 126 | except that |
63cccae4 KZ |
127 | .I i |
128 | becomes the new page size. | |
129 | .TP | |
130 | .BR . " or " ^L | |
131 | Redraw the screen. | |
132 | .TP | |
133 | .B $ | |
134 | Advance to the last line of the input file. | |
135 | .TP | |
136 | .IB i / pattern / | |
137 | Search forward until the first or the \fIi\fR-th | |
30a07f7e | 138 | occurrence of the Basic Regular Expression |
63cccae4 | 139 | .I pattern |
b63f3814 BS |
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. | |
63cccae4 KZ |
143 | .I i |
144 | must be a positive number. | |
145 | .TP | |
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 | |
48d7b13a | 148 | occurrence of the Basic Regular Expression |
63cccae4 | 149 | .I pattern |
b63f3814 | 150 | is found. The search starts |
63cccae4 | 151 | before the current page and stops at the beginning of the file. |
30a07f7e | 152 | No wrap-around is performed. |
63cccae4 KZ |
153 | .I i |
154 | must be a positive number. | |
155 | .PP | |
b63f3814 | 156 | The search commands accept an added letter. If |
63cccae4 KZ |
157 | .B t |
158 | is given, the line containing the pattern is displayed at the top of the | |
159 | screen, which is the default. | |
160 | .B m | |
161 | selects the middle and | |
162 | .B b | |
163 | the bottom of the screen. | |
164 | The selected position is used in following searches, too. | |
165 | .TP | |
166 | .IB i n | |
167 | Advance to the next file or | |
168 | .I i | |
169 | files forward. | |
170 | .TP | |
171 | .IB i p | |
172 | Reread the previous file or | |
173 | .I i | |
174 | files backward. | |
175 | .TP | |
176 | .BI s \ filename | |
177 | Save the current file to the given | |
178 | .I filename. | |
179 | .TP | |
180 | .B h | |
181 | Display a command summary. | |
182 | .TP | |
183 | .BI ! command | |
184 | Execute | |
185 | .I command | |
186 | using the shell. | |
187 | .TP | |
188 | .BR q " or " Q | |
189 | Quit. | |
190 | .PP | |
191 | If the user presses the interrupt or quit key while | |
b63f3814 | 192 | .B pg |
63cccae4 KZ |
193 | reads from the |
194 | input file or writes on the terminal, | |
b63f3814 | 195 | .B pg |
63cccae4 KZ |
196 | will immediately display the prompt. |
197 | In all other situations these keys will terminate | |
b63f3814 | 198 | .BR pg . |
63cccae4 KZ |
199 | .SH "ENVIRONMENT VARIABLES" |
200 | The following environment variables | |
ee312c65 | 201 | affect the behavior of |
b63f3814 | 202 | .BR pg : |
63cccae4 KZ |
203 | .TP |
204 | .B COLUMNS | |
205 | Overrides the system-supplied number of columns if set. | |
206 | .TP | |
207 | .BR LANG ,\ LC_ALL ,\ LC_COLLATE ,\ LC_CTYPE ,\ LC_MESSAGES | |
208 | See | |
42632a90 | 209 | .BR locale (7). |
63cccae4 KZ |
210 | .TP |
211 | .B LINES | |
212 | Overrides the system-supplied number of lines if set. | |
213 | .TP | |
214 | .B SHELL | |
215 | Used by the | |
b63f3814 | 216 | .BR ! " command." |
63cccae4 KZ |
217 | .TP |
218 | .B TERM | |
219 | Determines the terminal type. | |
220 | .SH "SEE ALSO" | |
221 | .BR cat (1), | |
222 | .BR more (1), | |
223 | .BR sh (1), | |
224 | .BR terminfo (5), | |
225 | .BR locale (7), | |
226 | .BR regex (7), | |
227 | .BR term (7) | |
228 | .SH NOTES | |
b63f3814 BS |
229 | .B pg |
230 | expects the terminal tabulators to be set every eight positions. | |
63cccae4 KZ |
231 | .PP |
232 | Files that include | |
233 | .SM NUL | |
234 | characters cannot be displayed by | |
b63f3814 | 235 | .BR pg . |
86d62711 | 236 | .SH AVAILABILITY |
601d12fb | 237 | The pg command is part of the util-linux package and is available from |
d673b74e | 238 | https://www.kernel.org/pub/linux/utils/util-linux/. |