xref: /original-bsd/bin/cat/cat.1 (revision 306a1b7a)
1.\" Copyright (c) 1989, 1990, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" the Institute of Electrical and Electronics Engineers, Inc.
6.\"
7.\" %sccs.include.redist.man%
8.\"
9.\"     @(#)cat.1	8.1 (Berkeley) 06/29/93
10.\"
11.Dd
12.Dt CAT 1
13.Os BSD 3
14.Sh NAME
15.Nm cat
16.Nd concatenate and print files
17.Sh SYNOPSIS
18.Nm cat
19.Op Fl benstuv
20.Op Fl
21.Op Ar
22.Sh DESCRIPTION
23The
24.Nm cat
25utility reads files sequentially, writing them to the standard output.
26The
27.Ar file
28operands are processed in command line order.
29A single dash represents the standard input.
30.Pp
31The options are as follows:
32.Bl -tag -width Ds
33.It Fl b
34Implies the
35.Fl n
36option but doesn't number blank lines.
37.It Fl e
38Implies the
39.Fl v
40option, and displays a dollar sign
41.Pq Ql \&$
42at the end of each line
43as well.
44.It Fl n
45Number the
46.Ar output
47lines, starting at 1.
48.It Fl s
49Squeeze multiple adjacent empty lines, causing the output to be
50single spaced.
51.It Fl t
52Implies the
53.Fl v
54option, and displays tab characters as
55.Pq Ql ^I
56as well.
57.It Fl u
58The
59.Fl u
60option guarantees that the output is unbuffered.
61.It Fl v
62Displays non-printing characters so they are visible.
63Control characters print as
64.Ql ^X
65for control-X; the delete
66character (octal 0177) prints as
67.Ql ^?
68Non-ascii characters (with the high bit set) are printed as
69.Ql M-
70(for meta) followed by the character for the low 7 bits.
71.El
72.Pp
73The
74.Nm cat
75utility exits 0 on success, and >0 if an error occurs.
76.Sh BUGS
77Because of the shell language mechanism used to perform output
78redirection, the command
79.Dq Li cat file1 file 2 > file1
80will cause the original data in file1 to be destroyed!
81.Sh SEE ALSO
82.Xr head 1 ,
83.Xr more 1 ,
84.Xr pr 1 ,
85.Xr tail 1
86.Rs
87.%A Rob Pike
88.%T "UNIX Style, or cat -v Considered Harmful"
89.%J "USENIX Summer Conference Proceedings"
90.%D 1983
91.Re
92.Sh HISTORY
93A
94.Nm
95command appeared in Version 6 AT&T UNIX.
96