nroff(1)

πŸ“¦
version 1.23.0 Β· 5 versions
, in centos-stream 10

πŸ’… nroff(1) β€” the girlies' guide to formatting docs for the terminal

okay so bestie, you're looking at nroff(1) from the General Commands Manual section, and honestly? she's iconic. let's get into it πŸŽ€


✨ NAME ✨

nroff β€” format documents with groff for TTY (terminal) devices πŸ–₯οΈπŸ’–


🌸 SYNOPSIS 🌸

nroff [-bcCEhikpRStUVz] [-d ctext] [-d string=text] [-K fallback-encoding] [-m macro-package] [-M macro-directory] [-n page-number] [-o page-list] [-P postprocessor-argument] [-r cnumeric-expression] [-r register=numeric-expression] [-T output-device] [-w warning-category] [-W warning-category] [file ...]

nroff --help

nroff -v
nroff --version

πŸ¦‹ DESCRIPTION πŸ¦‹

so nroff formats documents that are written in the groff(7) language β€” but for typewriter-like devices, aka terminal emulators. think of it as the terminal-glam edition of your doc ✨ GNU nroff literally emulates the AT&T nroff command using groff(1).

nroff generates its output via grotty(1), which is groff's terminal output driver β€” and she needs to know the character encoding scheme the device is using. consequently, the acceptable arguments to -T are ascii, latin1, utf8, and cp1047 β€” any others get ignored, no cap πŸ™ˆ

if neither the GROFF_TYPESETTER environment variable nor the -T command-line option (which overrides the environment variable, she's got main character energy) specifies a (valid) device, nroff consults the locale to select an appropriate output device. she first tries the locale(1) program, then checks several locale-related environment variables β€” see the β€œEnvironment” section below πŸ‘‡ if all of the foregoing fail, -Tascii is implied. periodt.

the -b, -c, -C, -d, -E, -i, -m, -M, -n, -o, -r, -U, -w, -W, and -z options have the effects described in troff(1). -c and -h imply β€œ-P-c” and β€œ-P-h”, respectively β€” and -c is also interpreted directly by troff. in addition, this implementation ignores the AT&T nroff options -e, -q, and -s (which are not implemented in groff). πŸ’€

the options -k, -K, -p, -P, -R, -t, and -S are documented in groff(1). -V causes nroff to display the constructed groff command on the standard output stream, but does not execute it πŸ‘€. -v and --version show version information about nroff and the programs it runs, while --help displays a usage message β€” all exit afterward. slay.


πŸ”₯ EXIT STATUS πŸ”₯

  • nroff exits with error status 2 if there was a problem parsing its arguments 😭
  • with status 0 if any of the options -V, -v, --version, or --help were specified πŸ‘‘
  • and with the status of groff otherwise.

🌈 ENVIRONMENT 🌈

normally, the path separator in environment variables ending with PATH is the colon β€” but this may vary depending on the operating system. for example, Windows uses a semicolon instead. iykyk 🫢

  • GROFF_BIN_PATH β€” is a colon-separated list of directories in which to search for the groff executable before searching in PATH. if unset, /usr/bin is used.
  • GROFF_TYPESETTER β€” specifies the default output device for groff.
  • LC_ALL, LC_CTYPE, LANG, LESSCHARSET β€” are pattern-matched in this order for contents matching standard character encodings supported by groff in the event no -T option is given and GROFF_TYPESETTER is unset, or the values specified are invalid.

πŸŽ€ FILES πŸŽ€

  • /usr/share/groff/1.23.0/tmac/tty-char.tmac β€” defines fallback definitions of roff special characters. these definitions more poorly optically approximate typeset output than those of tty.tmac in favor of communicating semantic information. nroff loads it automatically ✨

πŸ’œ NOTES πŸ’œ

pager programs like more(1) and less(1) may require command-line options to correctly handle some output sequences β€” see grotty(1) for the deets 🧚


⭐ SEE ALSO ⭐

groff(1), troff(1), grotty(1), locale(1), roff(7)


ngl bestie, if you're piping this into less, go read grotty(1) first β€” your girl deserves the right flags πŸ’…

and that's the whole vibe check πŸ¦‹ this page is from groff 1.23.0, dated 29 October 2024 β€” the nroff(1) era, and she ate πŸ’–

πŸ“¦ where this page comes from
  • centos-stream 10: groff-base 1.23.0-10.el10 Β· GPL-3.0-or-later AND GFDL-1.3-or-later AND BSD-4-Clause-UC AND MIT AND X11 AND LicenseRef-Fedora-Public-Domain
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms