📄 pg.1
字号:
.TH pg 1.SH Namepg \- file perusal filter for soft-copy terminals.SH Syntax.B pg.BI [\- number ].B [\-p.IB string ].B [\-cefs].BI [+ linenumber ].BI [+/ pattern /].BR [ files ...].SH Description.NXR "pg command"The.PN pgcommand is a filter that allows the examinationof.I filesone screenfulat a time on a soft-copy terminal.When the file name isdesignated by a minus (\-) and/or NULL argument,the.PN pgcommand reads from the standard input.Each screenful is followed by a prompt.If the user types a carriage return, another page is displayed..PPThis command is different from previous paginatorsbecause it allows you to back upand review material that has already passed..PPIn order to determine terminal attributes,.PN pgscans the.MS terminfo 5data base for the terminal type specified by theenvironment variableTERM.IfTERMis not defined,the terminal is assumed to be adumb terminal.The.PN pgcommand takes responses thatcan be dividedinto three categories: those causing further perusal, those thatsearch, and those that modify the perusal environment..PPCommands causing further perusal normally take a preceding.IR address,which is an optionally signed number indicating the point from whichfurther text should be displayed.This.I addressis interpreted in either pages or lines dependingon the command.A signed.I addressspecifies a point relative to the current pageor line, and an unsigned.I addressspecifies an address relativeto the beginning of the file.Each command has a default address that is used if none is provided..PPThe perusal commands and their defaults are as follows:.TP 20.RI (+1)< newline "> or <" blank >Causes one page to be displayed.The address is specified in pages..TP.RB "(+1) " lCauses.PN pgto simulate scrolling the screen, forward or backward,the number of lines specified when used with a relative address.With an absolute addressthis command prints a screenfulbeginning at the specified line..TP.RB "(+1) " d " or " ^DSimulates scrolling half a screen forward or backward..PPThe following perusal commands take no.IR address:.TP 20.BR . " or " ^LCauses the current page of textto be redisplayed..TP.B $Displays the last window full in the file.Use with caution when the input is a pipe..PPThe following commands are available for searching for text patternsin the text.The regular expressions described in.MS ed 1are available.They must always be terminated by a.RI < newline >,even if the.I \-noption is specified..TP 20.IB i / pattern /Searches forward for the.IR i th(default.IR i =1)occurrenceof.IR pattern.Searching begins immediately after the current page and continues to theend of the current file, without wrap-around..PP.IB i ^ pattern ^.PD 0.TP.IB i ? pattern ?Searches backwards for the.IR i th(default.IR i =1)occurrence of.IR pattern.Searching begins immediately before the current pageand continues to the beginning of the current file, withoutwrap-around.The circumflex (^) notation is useful for Adds 100 terminalswhich do nothandle the question mark (?) properly..PD.PPAfter searching,.PN pgnormally displays the line found at the top of the screen.This can be modified by appending m or bto the searchcommand to leave the line found in the middle or at the bottom ofthe window from now on.The suffix tcan be used to restore the original situation..PPThe user of.PN pgcan modify the environment of perusal with thefollowing commands:.TP 20.IB i nBegins perusing the.IR i thnext file in the command line.The.I iis an unsigned number. Default value is 1..TP.IB i Begins perusing the.IR i thprevious file in the command line..I iis an unsigned number. Default is 1..TP.IB i wDisplays another window of text.If.I iis present, sets the window size to.IR i..TP.BI "s " filenameSaves the input in the named file.Only the current file being perused is saved.The white space between the.B sand.I filenameis optional.This command must always be terminated by a.RI < newline >,even if the.I \-noption is specified..TP.B hHelps by displaying an abbreviated summary of available commands..TP.BR q " or " Q "Quits.PN pg ..TP\fB!\fIcommand\fRThe.I commandis passed to the shell, whose name istaken from theSHELLenvironment variable.If this is not available, the default shell is used.This command must always be terminated by a.RI < newline >,even if the.B \-noption is specified..PPAt any time when output is being sent to the terminal, the user can hitthe quit key (normally control-\\) or the interrupt (break) key.This causes.PN pgto stop sending output and to display the prompt.The user may then enter one of the above commands in the normal manner.Unfortunately, some output is lost when this is done, becauseany characters waiting in the terminal's output queue are flushedwhen the quit signal occurs..PPIf the standard output is not a terminal, then.PN pgacts just like.MS cat 1 ,except that a header is printed before each file (if there ismore than one)..SH OptionsThe command line options are:.TP 15.I \-numberSpecifies the size (in lines)of the window that.PN pgis to use instead of the default.(On a terminal containing 24 lines, the default window size is 23)..TP.BI \-p " string"Causes.PN pgto use .PN stringas the prompt.If the prompt string contains a %d, the first occurrenceof %d in the prompt is replacedby the current page number when the prompt is issued.The default prompt string is designated by a colon.RB (:) ..TP.B \-cHomes the cursor and clears the screen before displaying each page.This option is ignored if.B clear_screenis not defined for this terminal type in the.MS terminfo 5data base..TP.B \-eCauses.PN pg.I notto pause at the end of each file..TP.B \-fInhibits.PN pgfrom splitting lines.Normally,.PN pgsplits lines longer than the screen width,but some sequences of charactersin the text being displayed(for example, escape sequences for underlining)generate undesirable results.The.I \-foption prevents the splitting of these sequences..TP.B \-sCauses .PN pgto print all messages and prompts in standoutmode (usually inverse video)..TP.BI + linenumberStarts up at.IR linenumber..TP.BI +/ pattern /Starts up at the first line containingthe regular expression pattern..SH ExamplesThe following example shows how the.PN pgcommand is used reading system news:.EXnews | pg \-p "(Page %d):".EE.SH NotesWhile waiting for terminal input,.PN pgresponds to.BR \s-1BREAK\s+1 ,.BR \s-1DEL\s+1 and the circumflex (^)by terminating execution.Between prompts, however, these signals interrupt.PN pgcommand'scurrent task and place the user in prompt mode.These should be used with caution when input is being read froma pipe, since an interrupt is likely to terminate the othercommands in the pipeline..SH RestrictionsTerminal tabs must be set every eight positions..PPUsing.PN pgas a filter with another command changes the terminal I/Ooptions. For example,.MS crypt 1 terminal settings may not be restored correctly..SH Files.TP 22.PN /usr/lib/terminfo/*Terminal information data base.TP.PN /tmp/pg*Temporary file when input is from a pipe.SH See Alsocrypt(1), ed(1), grep(1), terminfo(5)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -