PG(1)

๐Ÿ“ฆ version 2.42.4, in arch rolling

๐Ÿฆ‹ 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, pg advances once a command letter is entered. lowkey a whole different vibe.
  • -p string โ€” 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.
  • id or ^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.
  • iw or iz โ€” 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? or ipattern โ€” 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.
  • s filename โ€” save the current file to the given filename.
  • h โ€” display a command summary.
  • !command โ€” execute command using the shell.
  • q or Q โ€” 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 โ€” see locale(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