PG(1)
๐ฆ PG(1) โ the pagewise browsing bestie
okay so you know how sometimes a file is just too much to dump into your terminal all at once? that's where pg comes in. it's the OG page-browser, living in section 1 of the manual (user commands), and she's here to feed you text one screenful at a time like the icon she is. ๐
โจ NAME โจ
pg โ browse pagewise through text files ๐
โจ SYNOPSIS โจ
pg -*amount *-p prompt -cefnrs +line +/pattern/ file_ ...
๐ธ DESCRIPTION ๐ธ
pg shows a text file on a CRT one screenful at once. after each page, she hits you with a prompt. then you, the main character, get to either press the newline key to see the next page, or use one of the keys listed down in COMMANDS. no cap. ๐ซถ
if you don't hand her a filename on the command line, pg reads from standard input. and if standard output isn't a terminal, pg acts like cat(1) โ except she puts each file's name in front of it if there's more than one. considerate queen behavior honestly.
if the input is coming from a pipe, pg stores the data in a buffer file while she's reading, so that navigation stays possible. slay. โจ
๐ OPTIONS ๐
pg accepts the following options:
+numberโ start at the given line number. ๐ฏ+/pattern*/โ start at the line containing the Basic Regular Expression pattern that you gave her.-numberโ the number of lines per page. by default this is the number of CRT lines minus one.-cโ clear the screen before a page is displayed, if the terminfo entry for the terminal provides this capability.-eโ do not pause and display(EOF)at the end of a file. no sad goodbye screen. ๐ญ-fโ do not split long lines.-nโ without this option, commands must be terminated by a newline character. with this option,pgadvances once a command letter is entered. lowkey a whole different vibe.-pstring โ instead of the normal prompt:, string is displayed. if string contains%d, its first occurrence is replaced by the number of the current page. cute, personalized.-rโ disallow the shell escape. ๐ซ-sโ print messages in standout mode, if the terminfo entry for the terminal provides this capability.-h,--helpโ display help text and exit.-V,--versionโ display version and exit.
๐ COMMANDS ๐
the following commands may be entered at the prompt. commands preceded by i in this document accept a number as argument, positive or negative. if that argument starts with + or -, it's interpreted relative to the current position in the input file, otherwise relative to the beginning. iykyk. ๐ซ
i<Enter>โ display the next or the indicated page.idor^Dโ display the next halfpage. if i is given, it is always interpreted relative to the current position.ilโ display the next or the indicated line.ifโ skip a page forward. i must be a positive number and is always interpreted relative to the current position.iworizโ as<Enter>except that i becomes the new page size..or^Lโ redraw the screen. refresh her, she deserves it. โจ$โ advance to the last line of the input file.i/pattern/โ search forward until the first or the i-th occurrence of the Basic Regular Expression pattern is found. the search starts after the current page and stops at the end of the file. no wrap-around is performed. i must be a positive number.i?pattern?oripatternโ search backward until the first or the i-th occurrence of the Basic Regular Expression pattern is found. the search starts before the current page and stops at the beginning of the file. no wrap-around is performed. i must be a positive number.
the search commands accept an added letter. if t is given, the line containing the pattern is displayed at the top of the screen, which is the default. m selects the middle and b the bottom of the screen. the selected position is used in following searches, too. ๐
inโ advance to the next file or i files forward.ipโ reread the previous file or i files backward.sfilename โ save the current file to the given filename.hโ display a command summary.!commandโ execute command using the shell.qorQโ quit. bye bestie ๐
if the user presses the interrupt or quit key while pg reads from the input file or writes on the terminal, pg will immediately display the prompt. in all other situations these keys will terminate pg.
๐ ENVIRONMENT ๐
the following environment variables affect the behavior of pg:
COLUMNSโ overrides the system-supplied number of columns if set.LANG,LC_ALL,LC_COLLATE,LC_CTYPE,LC_MESSAGESโ seelocale(7).LINESโ overrides the system-supplied number of lines if set.SHELLโ used by the!command.TERMโ determines the terminal type.
๐ง NOTES ๐ง
pg expects the terminal tabulators to be set every eight positions.
files that include NUL characters cannot be displayed by pg. ๐ not a vibe, just a fact.
โญ SEE ALSO โญ
cat(1), more(1), sh(1p), terminfo(5), locale(7), regex(7), term(7)
๐ REPORTING BUGS ๐
for bug reports, use the issue tracker <https://github.com/util-linux/util-linux/issues>.
๐ AVAILABILITY ๐
the pg command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.
and that's the whole page, bestie. this one's from util-linux 2.42.4, dated 2026-09-21 โ and yeah, it's literally titled PG(1). obsessed. ๐โจ๐ฆ
๐ฆ where this page comes from
- arch rolling: util-linux 2.42.4-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ISC AND LGPL-2.1-or-later AND LicenseRef-PublicDomain
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms