xref: /original-bsd/bin/cat/cat.1 (revision 948d00a2)
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.2 (Berkeley) 11/04/94
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 output lines, starting at 1.
46.It Fl s
47Squeeze multiple adjacent empty lines, causing the output to be
48single spaced.
49.It Fl t
50Implies the
51.Fl v
52option, and displays tab characters as
53.Ql ^I
54as well.
55.It Fl u
56The
57.Fl u
58option guarantees that the output is unbuffered.
59.It Fl v
60Displays non-printing characters so they are visible.
61Control characters print as
62.Ql ^X
63for control-X; the delete
64character (octal 0177) prints as
65.Ql ^?
66Non-ascii characters (with the high bit set) are printed as
67.Ql M-
68(for meta) followed by the character for the low 7 bits.
69.El
70.Pp
71The
72.Nm cat
73utility exits 0 on success, and >0 if an error occurs.
74.Sh BUGS
75Because of the shell language mechanism used to perform output
76redirection, the command
77.Dq Li cat file1 file 2 > file1
78will cause the original data in file1 to be destroyed!
79.Sh SEE ALSO
80.Xr head 1 ,
81.Xr more 1 ,
82.Xr pr 1 ,
83.Xr tail 1
84.Rs
85.%A Rob Pike
86.%T "UNIX Style, or cat -v Considered Harmful"
87.%J "USENIX Summer Conference Proceedings"
88.%D 1983
89.Re
90.Sh HISTORY
91A
92.Nm
93command appeared in Version 6 AT&T UNIX.
94