.\" Copyright (c) 1990 The Regents of the University of California. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by the University of .\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" @(#)pr.1 6.5 (Berkeley) 7/29/91 .\" .Dd July 29, 1991 .Dt PR 1 .Os BSD 4.3r .Sh NAME .Nm pr .Nd Print files. .Sh SYNOPSIS .Nm pr .Op Cm \&+ Ns Ar page .Op Fl Ns Ar column .Op Fl f .Op Fl h Ns Ar header .Op Fl l Ns Ar lines .Op Fl m .Op Fl s Ns Ar char .Op Fl t .Op Fl w Ns Ar width .Op Ar .Sh DESCRIPTION The .Nm pr utility is a printing and pagination filter. If multiple input files are specified, each is read, formatted, and written to standard output. By default, the input is separated into pages, each with a header that includes the page number, date, time, and the file's pathname. Text columns are of equal width, with at least one <blank> separation between text columns. Lines that do not fit into a text column are truncated. If standard output is associated with a terminal, diagnostic messages are suppressed until the .Nm utility has completed processing. .Pp The following options are available: .Bl -tag -width Fl .It Cm \&+ Ns Ar page Begin output at page number page of the formatted input. .It Fl Ns Ar column Produce output that is columns wide (default is 1) and is in text column rank order. This option should not be used with .Fl m . When used with .Fl t , use the minimum number of lines to display the output. .It Fl f Use <form-feed> character for new pages, instead of the default behavior that uses a sequence of <newline> characters. Prior to displaying the first page of output an <alert> character is written to standard output. .It Fl h Ns Ar header Use the string header as the header to be printed instead of file. .It Fl l Ns Ar lines Override the 66 line default and reset the page length to lines. If lines is smaller than the sum of both the header and trailer depths (in lines), the .Nm pr utility suppresses both the header and trailer, as if the .Fl t option were in effect. .It Fl m Merge files. Standard output is formatted so the .Nm pr utility writes one line from each file specified by a file operand, side by side into text columns of equal fixed widths, in terms of the number of column positions. .It Fl s Ns Ar char Separate text columns by the single character char instead of by the appropriate number of <space>s (default for char is the <tab> character). .It Fl t Print neither the five-line identifying header nor the five-line trailer usually supplied for each page. Quit printing after the last line of each file without spacing to the end of the page. .It Fl w Ns Ar width Set the width of the line to width column positions for multiple text-column output only (default is 72). .El .Pp The following operands are available: .Bl -tag -width Fl .It Ar file A pathname of a file to be printed. .El .Pp If no file operands are specified, or if a file operand is .Sq Fl , the standard input is used. .Pp The standard input is used only if no file operands are specified, or if a file operand is .Sq Fl . .Pp If .Nm pr receives an interrupt while printing to a terminal, it flushes all accumulated error messages to the screen before terminating. .Pp The .Nm pr utility output is a paginated version of the original file (or files). This pagination is optionally done using <form-feed>s or a sequence of <newline>s. Page headers are generated unless the .Fl t option is specified. .Pp The .Nm pr utility exits 0 on success, and >0 if an error occurs. .Pp Error messages are written to standard error during the printing process (if output is redirected) or after all successful file printing is complete (when printing to a terminal). .Sh SEE ALSO .Xr more 1 .Sh STANDARDS The .Nm pr function is expected to be .St -p1003.2 compatible.