Computer Hope

Other Pages

Home
Site map
Computer help

Dictionary
News
Q&A
What's new

Tools

E-mail this page
Print Preview
Edit this page



 

Linux / Unix pg command

Quick links

About pg
Syntax
Commands
Examples
Related commands
Linux / Unix main page

About pg

Files perusal filters for CRTs.

Syntax

pg [-number] [-p string] [-c] [-e] [-f] [-n] [-r][-s] [+ linenumber] [+/ pattern /] [filename]

-numberAn integer specifying the size (in lines) of the window that pg is to use instead of the default. (On a terminal containing 24 lines, the default window size is 23).
-p stringpg uses string as the prompt. If the prompt string contains a %d, the first occurrence of %d in the prompt will be replaced by the current page number when the prompt is issued. The default prompt string is ``:''.
-cHome the cursor and clear the screen before displaying each page. This option is ignored if clear_screen is not defined for this terminal type in the terminfo(4) data base.
-epg does not pause at the end of each file.
-fNormally, pg splits lines longer than the screen width, but some sequences of characters in the text being displayed (for instance, escape sequences for underlining) generate undesirable results. The -f option inhibits pg from splitting lines.
-nNormally, commands must be terminated by a <new line> character. This option causes an automatic end of command as soon as a command letter is entered
-rRestricted mode. The shell escape is disallowed. pg prints an error message but does not exit.
-spg prints all messages and prompts in the standard output mode (usually inverse video).
+linenumberStart up at linenumber.
|/pattern/Start up at the first line containing the regular expression pattern.
filenameA path name of a text file to be displayed. If no filename is given, or if it is -, the standard
input is read.

Commands

hhelp
q or Qquit
<blank> or <newline>next page
lnext line
d or <^D>display half a page more
. or <^L>redisplay current page
fskip the next page forward
nnext file
pprevious file
$last page
w or zset window size and display next page
s savefilesave current file in savefile
/pattern/search forward for pattern
?pattern? or ^pattern^search backward for pattern
!commandexecute command

Examples

pg myfile.txt - Would execute and display the file myfile.txt.

Related commands

cat
grep
more

 

Index

Category:
Linux / Unix

Companies:
Click here

Related Pages:

Resolved

Were you able to locate the answer to your questions?

Home - Computer help - Contact - Dictionary - Links
Link to Computer Hope - Bookmark Computer Hope