HP-UX Reference (11i v2 07/12) - 1 User Commands N-Z (vol 2)
p
pg(1) pg(1)
or line; an unsigned address specifies an address relative to the beginning of the file. Each command has a
default address that is used if none is provided.
Perusal commands and their defaults are as follows:
(+1)<newline>or<blank>
Displays one page. The address is specified in pages.
(+1) l With a relative address, pg
simulates scrolling the screen, forward or backward, the
number of lines specified. With an absolute address
pg prints a screenful beginning
at the specified line.
(+1)
d or ˆD Simulates scrolling a half-screen forward or backward.
if Skip i screens of text.
iz Same as newline except that i , if present, becomes the new default number of lines
per screenful.
The following perusal commands take no address:
. or ˆL Typing a single period causes the current page of text to be redisplayed.
$ Displays the last windowful in the file. Use with caution when the input is a pipe.
The following commands are available for searching for text patterns in the text. The Basic Regular
Expression syntax (see regexp(5)) is supported. The terminal /, ˆ,or? can be omitted from the pattern
search commands. Regular expressions must always be terminated by a new-line character, even if the
-n
option is specified.
i/pattern/ Search forward for the ith (default i=1) occurrence of pattern. Searching begins
immediately after the current page and continues to the end of the current file,
without wrap-around.
i
ˆpatternˆ
i?pattern? Search backwards for the ith (default i=1) occurrence of pattern. Searching begins
immediately before the current page and continues to the beginning of the current
file, without wrap-around. The
ˆ notation is useful for Adds 100 terminals which
cannot properly handle the ?.
After searching, pg normally displays the line found at the top of the screen. This can be modified by
appending m or b to the search command to leave the line found in the middle or at the bottom of the win-
dow from now on. The suffix t can be used to restore the original situation.
pg users can modify the perusal environment with the following commands:
in Begin perusing the ith next file in the command line. The i is an unsigned number,
default value is 1.
i
p Begin perusing the ith previous file in the command line. i is an unsigned number,
default is 1.
i
w Display another window of text. If i is present, set the window size to i.
s filename Save the input in the named file. Only the current file being perused is saved. The
white space between the s and filename is optional. This command must always be
terminated by a new-line character, even if the -n option is specified.
h Help by displaying an abbreviated summary of available commands.
q or Q Quit pg.
!command command is passed to the shell, whose name is taken from the SHELL environment
variable. If this is not available, the default shell is used. This command must always
be terminated by a new-line character, even if the -n option is specified.
At any time when the output is being sent to the terminal, the user can press the quit key (normally
CTRL-\), the interrupt (break) key or the DEL key. This causes pg to stop sending output, and display the
prompt. The user may then enter one of the commands in the normal manner. Unfortunately, some output
is lost when this is done, due to the fact that any characters waiting in the terminal’s output queue are
flushed when the quit signal occurs.
If the standard output is not a terminal, pg is functionally equivalent to cat (see cat(1)), except that a
header is printed before each file if more than one file is specified.
HP-UX 11i Version 2: December 2007 Update − 2 − Hewlett-Packard Company 149