2015-01-11 15:27:56 -06:00
|
|
|
.\" Copyright 2001 Gunnar Ritter
|
2014-07-15 16:07:36 -05:00
|
|
|
.TH PG 1 "July 2014" "util-linux" "User Commands"
|
2006-12-06 17:25:58 -06:00
|
|
|
.SH NAME
|
|
|
|
pg \- browse pagewise through text files
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.B pg
|
2014-07-15 16:07:36 -05:00
|
|
|
.RB [ \-\fIamount\fP ]
|
2009-07-22 04:29:05 -05:00
|
|
|
.RB [ \-p
|
2014-07-15 16:07:36 -05:00
|
|
|
.IR prompt ]
|
2009-07-22 04:29:05 -05:00
|
|
|
.RB [ \-cefnrs ]
|
|
|
|
.RB [ +\fIline\fP ]
|
|
|
|
.RB [ +/\fIpattern\fP/ ]
|
|
|
|
.RI [ file ...]
|
2006-12-06 17:25:58 -06:00
|
|
|
.SH DESCRIPTION
|
2011-08-18 15:18:34 -05:00
|
|
|
.B pg
|
2006-12-06 17:25:58 -06:00
|
|
|
displays a text file on a
|
|
|
|
.SM CRT
|
|
|
|
one screenful at once.
|
2011-08-19 15:38:46 -05:00
|
|
|
After each page, a prompt is displayed. The user may then either press the
|
2006-12-06 17:25:58 -06:00
|
|
|
newline key to view the next page or one of the keys described below.
|
|
|
|
.PP
|
|
|
|
If no filename is given on the command line,
|
2011-08-19 15:38:46 -05:00
|
|
|
.B pg
|
2006-12-06 17:25:58 -06:00
|
|
|
reads from standard input.
|
2011-08-19 15:38:46 -05:00
|
|
|
If standard output is not a terminal,
|
|
|
|
.B pg
|
2006-12-06 17:25:58 -06:00
|
|
|
acts like
|
2016-11-10 04:59:30 -06:00
|
|
|
.BR cat (1)
|
2006-12-06 17:25:58 -06:00
|
|
|
but precedes each file with its name if there is more than one.
|
|
|
|
.PP
|
|
|
|
If input comes from a pipe,
|
2011-08-19 15:38:46 -05:00
|
|
|
.B pg
|
2014-07-15 16:07:36 -05:00
|
|
|
stores the data in a buffer file while reading,
|
2006-12-06 17:25:58 -06:00
|
|
|
to make navigation possible.
|
|
|
|
.SH OPTIONS
|
2011-08-19 15:38:46 -05:00
|
|
|
.B pg
|
2006-12-06 17:25:58 -06:00
|
|
|
accepts the following options:
|
|
|
|
.TP
|
2013-06-18 10:02:40 -05:00
|
|
|
.BI + number
|
2014-07-15 16:07:36 -05:00
|
|
|
Start at the given line number.
|
2013-06-18 10:02:40 -05:00
|
|
|
.TP
|
|
|
|
.BI +/ pattern /
|
|
|
|
Start at the line containing the Basic Regular Expression
|
|
|
|
.I pattern
|
|
|
|
given.
|
|
|
|
.TP
|
2006-12-06 17:25:58 -06:00
|
|
|
.BI \- number
|
2014-07-15 16:07:36 -05:00
|
|
|
The number of lines per page. By default, this is the number of
|
2006-12-06 17:25:58 -06:00
|
|
|
.SM CRT
|
2011-08-19 15:38:46 -05:00
|
|
|
lines minus one.
|
2006-12-06 17:25:58 -06:00
|
|
|
.TP
|
|
|
|
.B \-c
|
2011-08-19 15:38:46 -05:00
|
|
|
Clear the screen before a page is displayed,
|
2006-12-06 17:25:58 -06:00
|
|
|
if the terminfo entry for the terminal provides this capability.
|
|
|
|
.TP
|
|
|
|
.B \-e
|
2011-08-19 15:38:46 -05:00
|
|
|
Do not pause and display
|
2006-12-06 17:25:58 -06:00
|
|
|
.SM (EOF)
|
|
|
|
at the end of a file.
|
|
|
|
.TP
|
|
|
|
.B \-f
|
2011-08-19 15:38:46 -05:00
|
|
|
Do not split long lines.
|
2006-12-06 17:25:58 -06:00
|
|
|
.TP
|
|
|
|
.B \-n
|
2011-08-19 15:38:46 -05:00
|
|
|
Without this option, commands must be terminated by a newline character.
|
|
|
|
With this option,
|
|
|
|
.B pg
|
2006-12-06 17:25:58 -06:00
|
|
|
advances once a command letter is entered.
|
|
|
|
.TP
|
|
|
|
.BI \-p \ string
|
2011-08-19 15:38:46 -05:00
|
|
|
Instead of the normal prompt
|
|
|
|
.IR : ,
|
2006-12-06 17:25:58 -06:00
|
|
|
.I string
|
|
|
|
is displayed.
|
|
|
|
If
|
|
|
|
.I string
|
|
|
|
contains
|
2014-07-15 16:07:36 -05:00
|
|
|
.BR %d ,
|
2011-08-19 15:38:46 -05:00
|
|
|
its first occurrence is replaced by the number of the current page.
|
2006-12-06 17:25:58 -06:00
|
|
|
.TP
|
|
|
|
.B \-r
|
|
|
|
Disallow the shell escape.
|
|
|
|
.TP
|
|
|
|
.B \-s
|
|
|
|
Print messages in
|
|
|
|
.I standout
|
2011-08-19 15:38:46 -05:00
|
|
|
mode,
|
2006-12-06 17:25:58 -06:00
|
|
|
if the terminfo entry for the terminal provides this capability.
|
|
|
|
.TP
|
2014-07-15 16:07:36 -05:00
|
|
|
.BR \-V , " \-\-version"
|
2016-05-29 15:54:03 -05:00
|
|
|
Display version information and exit.
|
2014-07-15 16:07:36 -05:00
|
|
|
.TP
|
|
|
|
.BR \-h , " \-\-help"
|
|
|
|
Display help text and exit.
|
|
|
|
.SH COMMANDS
|
2011-08-19 15:38:46 -05:00
|
|
|
The following commands may be entered at the prompt. Commands preceded by
|
2006-12-06 17:25:58 -06:00
|
|
|
.I i
|
|
|
|
in this document accept a number as argument, positive or negative.
|
|
|
|
If this argument starts with
|
2014-07-15 16:07:36 -05:00
|
|
|
.B +
|
2006-12-06 17:25:58 -06:00
|
|
|
or
|
2014-07-15 16:07:36 -05:00
|
|
|
.BR \- ,
|
2006-12-06 17:25:58 -06:00
|
|
|
it is interpreted relative to the current position in the input file,
|
|
|
|
otherwise relative to the beginning.
|
|
|
|
.TP
|
2014-07-15 16:07:36 -05:00
|
|
|
.IB i <Enter>
|
2006-12-06 17:25:58 -06:00
|
|
|
Display the next or the indicated page.
|
|
|
|
.TP
|
|
|
|
\fIi\fR\fBd\fR or \fB^D\fR
|
2011-08-19 15:38:46 -05:00
|
|
|
Display the next halfpage. If
|
2006-12-06 17:25:58 -06:00
|
|
|
.I i
|
|
|
|
is given, it is always interpreted relative to the current position.
|
|
|
|
.TP
|
|
|
|
.IB i l
|
|
|
|
Display the next or the indicated line.
|
|
|
|
.TP
|
|
|
|
.IB i f
|
|
|
|
Skip a page forward.
|
|
|
|
.I i
|
|
|
|
must be a positive number and is always interpreted relative
|
|
|
|
to the current position.
|
|
|
|
.TP
|
|
|
|
\fIi\fR\fBw\fR or \fIi\fR\fBz\fR
|
2014-07-15 16:07:36 -05:00
|
|
|
As
|
|
|
|
.B <Enter>
|
2009-07-22 04:29:05 -05:00
|
|
|
except that
|
2006-12-06 17:25:58 -06:00
|
|
|
.I i
|
|
|
|
becomes the new page size.
|
|
|
|
.TP
|
|
|
|
.BR . " or " ^L
|
|
|
|
Redraw the screen.
|
|
|
|
.TP
|
|
|
|
.B $
|
|
|
|
Advance to the last line of the input file.
|
|
|
|
.TP
|
|
|
|
.IB i / pattern /
|
|
|
|
Search forward until the first or the \fIi\fR-th
|
2009-07-22 04:29:05 -05:00
|
|
|
occurrence of the Basic Regular Expression
|
2006-12-06 17:25:58 -06:00
|
|
|
.I pattern
|
2011-08-19 15:38:46 -05:00
|
|
|
is found. The search starts
|
|
|
|
after the current page and stops at the end of the file.
|
|
|
|
No wrap-around is performed.
|
2006-12-06 17:25:58 -06:00
|
|
|
.I i
|
|
|
|
must be a positive number.
|
|
|
|
.TP
|
|
|
|
\fIi\fR\fB?\fR\fIpattern\fR\fB?\fR or \fIi\fR\fB^\fR\fIpattern\fR\fB^\fR
|
|
|
|
Search backward until the first or the \fIi\fR-th
|
2006-12-06 17:26:54 -06:00
|
|
|
occurrence of the Basic Regular Expression
|
2006-12-06 17:25:58 -06:00
|
|
|
.I pattern
|
2011-08-19 15:38:46 -05:00
|
|
|
is found. The search starts
|
2006-12-06 17:25:58 -06:00
|
|
|
before the current page and stops at the beginning of the file.
|
2009-07-22 04:29:05 -05:00
|
|
|
No wrap-around is performed.
|
2006-12-06 17:25:58 -06:00
|
|
|
.I i
|
|
|
|
must be a positive number.
|
|
|
|
.PP
|
2011-08-19 15:38:46 -05:00
|
|
|
The search commands accept an added letter. If
|
2006-12-06 17:25:58 -06:00
|
|
|
.B t
|
|
|
|
is given, the line containing the pattern is displayed at the top of the
|
|
|
|
screen, which is the default.
|
|
|
|
.B m
|
|
|
|
selects the middle and
|
|
|
|
.B b
|
|
|
|
the bottom of the screen.
|
|
|
|
The selected position is used in following searches, too.
|
|
|
|
.TP
|
|
|
|
.IB i n
|
|
|
|
Advance to the next file or
|
|
|
|
.I i
|
|
|
|
files forward.
|
|
|
|
.TP
|
|
|
|
.IB i p
|
|
|
|
Reread the previous file or
|
|
|
|
.I i
|
|
|
|
files backward.
|
|
|
|
.TP
|
|
|
|
.BI s \ filename
|
|
|
|
Save the current file to the given
|
|
|
|
.I filename.
|
|
|
|
.TP
|
|
|
|
.B h
|
|
|
|
Display a command summary.
|
|
|
|
.TP
|
|
|
|
.BI ! command
|
|
|
|
Execute
|
|
|
|
.I command
|
|
|
|
using the shell.
|
|
|
|
.TP
|
|
|
|
.BR q " or " Q
|
|
|
|
Quit.
|
|
|
|
.PP
|
|
|
|
If the user presses the interrupt or quit key while
|
2011-08-19 15:38:46 -05:00
|
|
|
.B pg
|
2006-12-06 17:25:58 -06:00
|
|
|
reads from the
|
|
|
|
input file or writes on the terminal,
|
2011-08-19 15:38:46 -05:00
|
|
|
.B pg
|
2006-12-06 17:25:58 -06:00
|
|
|
will immediately display the prompt.
|
|
|
|
In all other situations these keys will terminate
|
2011-08-19 15:38:46 -05:00
|
|
|
.BR pg .
|
2006-12-06 17:25:58 -06:00
|
|
|
.SH "ENVIRONMENT VARIABLES"
|
|
|
|
The following environment variables
|
2014-06-06 02:49:35 -05:00
|
|
|
affect the behavior of
|
2011-08-19 15:38:46 -05:00
|
|
|
.BR pg :
|
2006-12-06 17:25:58 -06:00
|
|
|
.TP
|
|
|
|
.B COLUMNS
|
|
|
|
Overrides the system-supplied number of columns if set.
|
|
|
|
.TP
|
|
|
|
.BR LANG ,\ LC_ALL ,\ LC_COLLATE ,\ LC_CTYPE ,\ LC_MESSAGES
|
|
|
|
See
|
2016-11-10 04:59:30 -06:00
|
|
|
.BR locale (7).
|
2006-12-06 17:25:58 -06:00
|
|
|
.TP
|
|
|
|
.B LINES
|
|
|
|
Overrides the system-supplied number of lines if set.
|
|
|
|
.TP
|
|
|
|
.B SHELL
|
|
|
|
Used by the
|
2011-08-19 15:38:46 -05:00
|
|
|
.BR ! " command."
|
2006-12-06 17:25:58 -06:00
|
|
|
.TP
|
|
|
|
.B TERM
|
|
|
|
Determines the terminal type.
|
|
|
|
.SH "SEE ALSO"
|
|
|
|
.BR cat (1),
|
|
|
|
.BR more (1),
|
|
|
|
.BR sh (1),
|
|
|
|
.BR terminfo (5),
|
|
|
|
.BR locale (7),
|
|
|
|
.BR regex (7),
|
|
|
|
.BR term (7)
|
|
|
|
.SH NOTES
|
2011-08-19 15:38:46 -05:00
|
|
|
.B pg
|
|
|
|
expects the terminal tabulators to be set every eight positions.
|
2006-12-06 17:25:58 -06:00
|
|
|
.PP
|
|
|
|
Files that include
|
|
|
|
.SM NUL
|
|
|
|
characters cannot be displayed by
|
2011-08-19 15:38:46 -05:00
|
|
|
.BR pg .
|
2007-07-02 18:17:04 -05:00
|
|
|
.SH AVAILABILITY
|
2010-11-30 04:41:59 -06:00
|
|
|
The pg command is part of the util-linux package and is available from
|
2016-12-17 02:06:57 -06:00
|
|
|
https://www.kernel.org/pub/linux/utils/util-linux/.
|