xref: /freebsd/usr.bin/fold/fold.1 (revision ad30f8e79bd1007cc2476e491bd21b4f5e389e0a)
1.\" Copyright (c) 1980, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\" 4. Neither the name of the University nor the names of its contributors
13.\"    may be used to endorse or promote products derived from this software
14.\"    without specific prior written permission.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\"	@(#)fold.1	8.1 (Berkeley) 6/6/93
29.\" $FreeBSD$
30.\"
31.Dd December 15, 2006
32.Dt FOLD 1
33.Os
34.Sh NAME
35.Nm fold
36.Nd "fold long lines for finite width output device"
37.Sh SYNOPSIS
38.Nm
39.Op Fl bs
40.Op Fl w Ar width
41.Op Ar
42.Sh DESCRIPTION
43The
44.Nm
45utility is a filter which folds the contents of the specified files,
46or the standard input if no files are specified,
47breaking the lines to have a maximum of 80 columns.
48.Pp
49The options are as follows:
50.Bl -tag -width indent
51.It Fl b
52Count
53.Ar width
54in bytes rather than column positions.
55.It Fl s
56Fold line after the last blank character within the first
57.Ar width
58column positions (or bytes).
59.It Fl w Ar width
60Specify a line width to use instead of the default 80 columns.
61The
62.Ar width
63value
64should be a multiple of 8 if tabs are present, or the tabs should
65be expanded using
66.Xr expand 1
67before using
68.Nm .
69.El
70.Sh ENVIRONMENT
71The
72.Ev LANG , LC_ALL
73and
74.Ev LC_CTYPE
75environment variables affect the execution of
76.Nm
77as described in
78.Xr environ 7 .
79.Sh SEE ALSO
80.Xr expand 1 ,
81.Xr fmt 1
82.Sh STANDARDS
83The
84.Nm
85utility conforms to
86.St -p1003.1-2001 .
87.Sh BUGS
88If underlining (see
89.Xr ul 1 )
90is present it may be messed up by folding.
91