Commit | Line | Data |
---|---|---|
b5dc1377 | 1 | .\" Copyright (c) 1989, 1990 The Regents of the University of California. |
ea642694 | 2 | .\" All rights reserved. |
e8cca28c | 3 | .\" |
cf136d2c KB |
4 | .\" This code is derived from software contributed to Berkeley by |
5 | .\" the Institute of Electrical and Electronics Engineers, Inc. | |
6 | .\" | |
27c71911 | 7 | .\" %sccs.include.redist.man% |
ea642694 | 8 | .\" |
cf136d2c | 9 | .\" @(#)cat.1 6.16 (Berkeley) %G% |
e8cca28c | 10 | .\" |
b5dc1377 CL |
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 | |
bf40f8ff | 21 | .Op Ar |
b5dc1377 | 22 | .Sh DESCRIPTION |
ea642694 | 23 | The |
b5dc1377 | 24 | .Nm cat |
ea642694 | 25 | utility reads files sequentially, writing them to the standard output. |
334f3902 | 26 | The |
b5dc1377 | 27 | .Ar file |
ea642694 KB |
28 | operands are processed in command line order. |
29 | A single dash represents standard input. | |
b5dc1377 | 30 | .Pp |
49c5b53c | 31 | The options are as follows: |
bf40f8ff CL |
32 | .Bl -tag -width Ds |
33 | .It Fl b | |
49c5b53c | 34 | Implies the |
b5dc1377 | 35 | .Fl n |
49c5b53c | 36 | option but doesn't number blank lines. |
bf40f8ff | 37 | .It Fl e |
49c5b53c | 38 | Implies the |
b5dc1377 | 39 | .Fl v |
bf40f8ff CL |
40 | option, and displays a dollar sign |
41 | .Pq Ql \&$ | |
42 | at the end of each line | |
49c5b53c | 43 | as well. |
bf40f8ff | 44 | .It Fl n |
49c5b53c | 45 | Number the |
b5dc1377 | 46 | .Ar output |
49c5b53c | 47 | lines, starting at 1. |
bf40f8ff | 48 | .It Fl s |
49c5b53c KB |
49 | Squeeze multiple adjacent empty lines, causing the output to be |
50 | single spaced. | |
bf40f8ff | 51 | .It Fl t |
49c5b53c | 52 | Implies the |
b5dc1377 | 53 | .Fl v |
bf40f8ff CL |
54 | option, and displays tab characters as |
55 | .Pq Ql ^I | |
56 | as well. | |
57 | .It Fl u | |
334f3902 | 58 | The |
5325ced3 CL |
59 | .Fl u |
60 | option guarantees that the output is unbuffered. | |
bf40f8ff | 61 | .It Fl v |
49c5b53c | 62 | Displays non-printing characters so they are visible. |
bf40f8ff CL |
63 | Control characters print line |
64 | .Ql ^X | |
65 | for control-X; the delete | |
66 | character (octal 0177) prints as | |
67 | .Ql ^? | |
49c5b53c | 68 | Non-ascii characters (with the high bit set) are printed as |
bf40f8ff CL |
69 | .Ql M- |
70 | (for meta) followed by the character for the low 7 bits. | |
71 | .El | |
b5dc1377 | 72 | .Pp |
0351bf1a KB |
73 | The |
74 | .Nm cat | |
75 | utility exits 0 on success, and >0 if an error occurs. | |
76 | .Sh BUGS | |
ea642694 | 77 | Because of the shell language mechanism used to perform output |
bf40f8ff CL |
78 | redirection, the command |
79 | .Dq Li cat file1 file 2 > file1 | |
0351bf1a | 80 | will cause the original data in file1 to be destroyed! |
b5dc1377 CL |
81 | .Sh SEE ALSO |
82 | .Xr head 1 , | |
83 | .Xr more 1 , | |
84 | .Xr pr 1 , | |
85 | .Xr tail 1 | |
bf40f8ff CL |
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 | |
b5dc1377 | 92 | .Sh HISTORY |
bf40f8ff | 93 | A |
b5dc1377 | 94 | .Nm |
bf40f8ff | 95 | command appeared in Version 6 AT&T UNIX. |