finish what I started
[unix-history] / usr / src / bin / cat / cat.1
CommitLineData
e8cca28c
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
30cfaafc 5.\" @(#)cat.1 6.3 (Berkeley) %G%
e8cca28c 6.\"
5f02176b 7.TH CAT 1 ""
e8cca28c
KM
8.UC 4
9.SH NAME
10cat \- catenate and print
11.SH SYNOPSIS
12.B cat
13[
30cfaafc 14.B \-benstuv
e8cca28c
KM
15]
16file ...
17.br
18.SH DESCRIPTION
19.I Cat
20reads each
21.I file
334f3902 22in sequence and displays it on the standard output. Thus
e8cca28c
KM
23.PP
24.ti+15n
25cat file
26.PP
334f3902 27displays the file on the standard output, and
e8cca28c
KM
28.PP
29.ti+15n
30cat file1 file2 >file3
31.PP
32concatenates the first two files and places the result on the third.
33.PP
334f3902 34If no input file is given, or if the argument `\-' is encountered,
e8cca28c 35.I cat
334f3902 36reads from the standard input file.
12fe7496
KM
37Output is buffered in the block size recommended by \fIstat\fP(2)
38unless the standard output is a terminal,
39when it is line buffered. The
e8cca28c 40.B \-u
334f3902 41option makes the output completely unbuffered.
e8cca28c 42.PP
334f3902 43The
e8cca28c 44.B \-n
334f3902
KM
45option displays the output lines preceded by lines numbers, numbered
46sequentially from 1. Specifying the
e8cca28c 47.B \-b
334f3902 48option with the
e8cca28c 49.B \-n
334f3902 50option omits the line numbers from blank lines.
e8cca28c 51.PP
334f3902 52The
e8cca28c 53.B \-s
334f3902
KM
54option crushes out multiple adjacent empty lines so that the
55output is displayed single spaced.
e8cca28c 56.PP
334f3902 57The
e8cca28c 58.B \-v
334f3902 59option displays non-printing characters so that they are visible.
e8cca28c
KM
60Control characters print like ^X for control-x; the delete character
61(octal 0177) prints as ^?.
62Non-ascii characters (with the high bit set) are printed as M-
334f3902 63(for meta) followed by the character of the low 7 bits. A
e8cca28c 64.B \-e
334f3902 65option may be given with the
e8cca28c 66.B \-v
334f3902
KM
67option, which displays a `$' character at the end of each line.
68Specifying the
e8cca28c 69.B \-t
334f3902 70option with the
e8cca28c 71.B \-v
334f3902 72option displays tab characters as ^I.
e8cca28c
KM
73.PP
74.SH "SEE ALSO"
75cp(1), ex(1), more(1), pr(1), tail(1)
76.SH BUGS
77Beware of `cat a b >a' and `cat a b >b', which destroy
78the input files before reading them.