A2PS(1)

๐Ÿ’– NAME ๐Ÿ’–

a2ps โ€” bestie, it formats your files for printing on a PostScript printer โœจ

๐ŸŒธ SYNOPSIS ๐ŸŒธ

a2ps [OPTION]... [FILE]...

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

Okay so here's the vibe: a2ps converts FILE(s) โ€” or standard input if you're feeling mysterious โ€” into PostScript, no cap. By default the output just goes straight to the default printer like it's sliding into the DMs. Wanna aim it somewhere specific? Pass an output file with -o. ๐Ÿ’…

Real talk though, and this part is important so listen up: mandatory arguments to long options are mandatory for short options too. And long options marked with * are the ones that need a yes/no argument โ€” the matching short options stand for yes, periodt.

๐Ÿ‘‘ Tasks ๐Ÿ‘‘

  • --version โ€” displays the version, obviously ๐Ÿ’
  • --help โ€” displays this help
  • --guess โ€” reports the guessed types of FILES
  • --which โ€” reports the full path of library files named FILES
  • --glob โ€” reports the full path of library files matching FILES
  • --list=defaults โ€” displays default settings and parameters
  • --list=TOPIC โ€” gives you a detailed list on TOPIC, and the topics are: delegations, encodings, features, variables, media, ppd, printers, prologues, style-sheets, user-options

So after it's done with the task, it exits successfully, slay. And lowkey the detailed lists can give you extra help on specific features โ€” iykyk.

๐Ÿ”ฅ Global ๐Ÿ”ฅ

  • -q, --quiet, --silent โ€” be really quiet ๐Ÿคซ
  • -v, --verbose[=LEVEL] โ€” turn verbosity on, or crank it to LEVEL
  • -=, --user-option=OPTION โ€” use the user defined shortcut OPTION
  • --debug โ€” enables debugging features (for when you gotta see everything ๐Ÿ‘€)
  • -D, --define=KEY[:VALUE] โ€” unset variable KEY, or set it to VALUE

๐ŸŽ€ Sheets ๐ŸŽ€

  • -M, --medium=NAME โ€” use output medium NAME
  • -r, --landscape โ€” print in landscape mode
  • -R, --portrait โ€” print in portrait mode
  • --columns=NUM โ€” number of columns per sheet
  • --rows=NUM โ€” number of rows per sheet
  • --major=DIRECTION โ€” first fill (DIRECTION=) rows, or columns
  • -1, -2, ..., -9 โ€” predefined font sizes and layouts for 1..9 virtuals
  • -A, --file-align=MODE โ€” align separate files according to MODE (fill, rank page, sheet, or a number)
  • -j, --borders* โ€” print borders around columns
  • --margin[=NUM] โ€” define an interior margin of size NUM
Heads up bestie, this one's a little sneaky: the options -1.. -9 affect several primitive parameters to set up predefined layouts with 80 columns. So the order matters: -R -f40 -2 is equivalent to -2. If you actually wanna modify the layout, use -2Rf40, or compose primitive options (--columns, --font-size etc.). Don't get caught lacking on the ordering ๐Ÿ˜ญ

๐Ÿงš Virtual pages ๐Ÿงš

  • --line-numbers=NUM โ€” precede each NUM lines with its line number
  • -C โ€” alias for --line-numbers=5
  • -f, --font-size=SIZE โ€” use font SIZE (float) for the body text
  • -L, --lines-per-page=NUM โ€” scale the font to print NUM lines per virtual
  • -l, --chars-per-line=NUM โ€” scale the font to print NUM columns per virtual
  • -m, --catman โ€” process FILE as a man page (same as -L66)
  • -T, --tabsize=NUM โ€” set tabulator size to NUM
  • --non-printable-format=FMT โ€” specify how non-printable chars are printed

๐ŸŒˆ Headings ๐ŸŒˆ

  • -B, --no-header โ€” no page headers at all ๐Ÿ™ˆ
  • -b, --header[=TEXT] โ€” set page header
  • -u, --underlay[=TEXT] โ€” print TEXT under every page
  • --center-title[=TEXT] โ€” set page title to TITLE
  • --left-title[=TEXT] โ€” set left and right page title to TEXT
  • --right-title[=TEXT] โ€” (same deal as above, it's the pair ๐Ÿซถ)
  • --left-footer[=TEXT] โ€” set sheet footers to TEXT
  • --footer[=TEXT] โ€” (also part of the footer trio)
  • --right-footer[=TEXT] โ€” (and the last of the trio)

Oh and FYI, the *TEXT*s may use special escapes โœจ

๐Ÿ“ Input ๐Ÿ“

  • -a, --pages[=RANGE] โ€” select the pages to print
  • -c, --truncate-lines* โ€” cut long lines
  • -i, --interpret* โ€” interpret tab, bs and ff chars
  • --end-of-line=TYPE โ€” specify the eol char (TYPE: r, n, nr, rn, any)
  • -X, --encoding=NAME โ€” use input encoding NAME
  • -t, --title=NAME โ€” set the name of the job
  • --stdin=NAME โ€” set the name of the input file stdin
  • --print-anyway* โ€” force binary printing (living dangerously, love that)
  • -Z, --delegate* โ€” delegate files to another application
  • --toc[=TEXT] โ€” generate a table of content
So when delegations are enabled, a2ps may use other applications to handle the processing of files that should not be printed as raw information โ€” think HTML PostScript, PDF etc. Iconic teamwork honestly ๐Ÿ’œ

๐Ÿ’… Pretty-printing ๐Ÿ’…

  • -E, --pretty-print[=LANG] โ€” enable pretty-printing (set style to LANG)
  • --highlight-level=LEVEL โ€” set pretty printing highlight LEVEL; LEVEL can be none, normal or heavy
  • -g โ€” alias for --highlight-level=heavy
  • --strip-level=NUM โ€” level of comments stripping

โญ Output โญ

  • -o, --output=FILE โ€” leave output to file FILE. And if FILE is -, leave output to stdout. Cute, right?
  • --version-control=WORD โ€” override the usual version control
  • --suffix=SUFFIX โ€” override the usual backup suffix
  • -P, --printer=NAME โ€” send output to printer NAME
  • -d โ€” send output to the default printer (this is the default behavior, bestie, it's giving main character energy)

๐Ÿงš PostScript ๐Ÿงš

  • --prologue=FILE โ€” include FILE.pro as PostScript prologue
  • --ppd[=KEY] โ€” automatic PPD selection, or set to KEY
  • -n, --copies=NUM โ€” print NUM copies of each page
  • -s, --sides=MODE โ€” set the duplex MODE (1 or simplex, 2 or duplex, tumble)
  • -S, --setpagedevice=K[:V] โ€” pass a page device definition to output
  • --statusdict=K[:[:]V] โ€” pass a statusdict definition to the output
  • -k, --page-prefeed โ€” enable page prefeed
  • -K, --no-page-prefeed โ€” disable page prefeed

Okay and here's the thing โ€” by default a2ps is tuned to do what you want to, so trust it. ๐Ÿ’ฏ But here are the examples anyway, because they're lowkey iconic:

To pretty print the content of the src directory and a table of content, and send the result to the printer lw:

$ a2ps -P lw --toc src/*

To process the files sample.ps and sample.html and display the result:

$ a2ps -P display sample.ps sample.html

To process a mailbox in 4 up:

$ a2ps -=mail -4 mailbox

To print as a booklet on the default printer, which is duplex capable:

$ a2ps -=book paper.dvi.gz -d

๐ŸŽ€ FILES ๐ŸŽ€

So a2ps reads several files before the command line options. In order, they are:

  1. The system configuration file (usually /usr/local/etc/a2ps.cfg) โ€” unless you've defined the environment variable A2PS_CONFIG, in which case a2ps reads the file it points to;
  2. the user's home configuration file ($HOME/.a2ps/a2psrc);
  3. the file .a2psrc in the current directory.

See the info manual for more information, including a description of the configuration file format. Go read it, it's good for you ๐Ÿ“š

๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Written by Akim Demaille, Miguel Santana, and Reuben Thomas. Kings, honestly.

๐Ÿฆ‹ REPORTING BUGS ๐Ÿฆ‹

Copyright ยฉ 2025 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.

This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. (Seriously, none, don't come for them ๐Ÿ˜ญ)

๐ŸŒธ SEE ALSO ๐ŸŒธ

a2ps(1), card(1), fixps(1), pdiff(1).

The full documentation for a2ps is maintained as a Texinfo manual. If the info and a2ps programs are properly installed at your site, the command

info a2ps

should give you access to the complete manual. Slay ๐Ÿซถ


And that's the whole thing, bestie โ€” this was GNU a2ps 4.15.7, dated December 2025. Go print something pretty โœจ๐ŸŽ€๐Ÿ’–

๐Ÿ“ฆ where this page comes from