redo synopsis line, define exit values
[unix-history] / usr / src / bin / cat / cat.1
CommitLineData
ea642694
KB
1.\" Copyright (c) 1989 The Regents of the University of California.
2.\" All rights reserved.
e8cca28c 3.\"
ea642694
KB
4.\" Redistribution and use in source and binary forms are permitted
5.\" provided that the above copyright notice and this paragraph are
6.\" duplicated in all such forms and that any documentation,
7.\" advertising materials, and other materials related to such
8.\" distribution and use acknowledge that the software was developed
9.\" by the University of California, Berkeley. The name of the
10.\" University may not be used to endorse or promote products derived
11.\" from this software without specific prior written permission.
12.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
15.\"
01ac33f9 16.\" @(#)cat.1 6.6 (Berkeley) %G%
e8cca28c 17.\"
5f02176b 18.TH CAT 1 ""
ea642694 19.UC 1
e8cca28c 20.SH NAME
ea642694 21cat \- concatenate and print files
e8cca28c 22.SH SYNOPSIS
01ac33f9
KB
23\fBcat [ \fI-benstuv\fB ] [ \fI-\fB ] [ \fIfile ...\fB ]
24.ft R
e8cca28c 25.SH DESCRIPTION
ea642694 26The
e8cca28c 27.I cat
ea642694 28utility reads files sequentially, writing them to the standard output.
334f3902 29The
ea642694
KB
30.I file
31operands are processed in command line order.
32A single dash represents standard input.
e8cca28c 33.PP
49c5b53c
KB
34The options are as follows:
35.TP
36.I -b
37Implies the
38.I -n
39option but doesn't number blank lines.
40.TP
41.I -e
42Implies the
43.I -v
44option, and displays a dollar sign (``$'') at the end of each line
45as well.
46.TP
47.I -n
48Number the
49.I output
50lines, starting at 1.
51.TP
52.I -s
53Squeeze multiple adjacent empty lines, causing the output to be
54single spaced.
55.TP
56.I -t
57Implies the
58.I -v
59option, and displays tab characters as ``^I'' as well.
60.TP
61.I -u
334f3902 62The
49c5b53c 63.I \-u
ea642694 64option guarantees that the output is unbuffered.
49c5b53c
KB
65.TP
66.I -v
67Displays non-printing characters so they are visible.
68Control characters print line ``^X'' for control-X; the delete
69character (octal 0177) prints as ``^?''.
70Non-ascii characters (with the high bit set) are printed as
71``M-'' (for meta) followed by the character for the low 7 bits.
e8cca28c 72.PP
ea642694
KB
73The command ``cat file1 file2 > file3'' concatenates the contents of
74file1 and file2 and places the result in file3.
e8cca28c 75.PP
ea642694
KB
76Because of the shell language mechanism used to perform output
77redirection, the command ``cat file1 file 2 > file1'' will cause
78the original data in file1 to be destroyed!
01ac33f9
KB
79.PP
80.I Cat
81exits 0 on success, >0 if an error occurred.
e8cca28c 82.SH "SEE ALSO"
ea642694
KB
83head(1), more(1), pr(1), tail(1)
84.br
85Rob Pike, ``UNIX Style, or cat -v Considered Harmful''
86USENIX Summer Conference Proceedings, 1983.