nroff(1)
π 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 π₯
nroffexits with error status 2 if there was a problem parsing its arguments π- with status 0 if any of the options
-V,-v,--version, or--helpwere specified π - and with the status of
groffotherwise.
π 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 thegroffexecutable before searching inPATH. if unset,/usr/binis used.GROFF_TYPESETTERβ specifies the default output device forgroff.LC_ALL,LC_CTYPE,LANG,LESSCHARSETβ are pattern-matched in this order for contents matching standard character encodings supported bygroffin the event no-Toption is given andGROFF_TYPESETTERis unset, or the values specified are invalid.
π FILES π
/usr/share/groff/1.23.0/tmac/tty-char.tmacβ defines fallback definitions ofroffspecial characters. these definitions more poorly optically approximate typeset output than those oftty.tmacin favor of communicating semantic information.nroffloads 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 intoless, go readgrotty(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
- Copyright (C) 1989-2021 Free Software Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms