Commit | Line | Data |
---|---|---|
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 | 21 | cat \- 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 | 26 | The |
e8cca28c | 27 | .I cat |
ea642694 | 28 | utility reads files sequentially, writing them to the standard output. |
334f3902 | 29 | The |
ea642694 KB |
30 | .I file |
31 | operands are processed in command line order. | |
32 | A single dash represents standard input. | |
e8cca28c | 33 | .PP |
49c5b53c KB |
34 | The options are as follows: |
35 | .TP | |
36 | .I -b | |
37 | Implies the | |
38 | .I -n | |
39 | option but doesn't number blank lines. | |
40 | .TP | |
41 | .I -e | |
42 | Implies the | |
43 | .I -v | |
44 | option, and displays a dollar sign (``$'') at the end of each line | |
45 | as well. | |
46 | .TP | |
47 | .I -n | |
48 | Number the | |
49 | .I output | |
50 | lines, starting at 1. | |
51 | .TP | |
52 | .I -s | |
53 | Squeeze multiple adjacent empty lines, causing the output to be | |
54 | single spaced. | |
55 | .TP | |
56 | .I -t | |
57 | Implies the | |
58 | .I -v | |
59 | option, and displays tab characters as ``^I'' as well. | |
60 | .TP | |
61 | .I -u | |
334f3902 | 62 | The |
49c5b53c | 63 | .I \-u |
ea642694 | 64 | option guarantees that the output is unbuffered. |
49c5b53c KB |
65 | .TP |
66 | .I -v | |
67 | Displays non-printing characters so they are visible. | |
68 | Control characters print line ``^X'' for control-X; the delete | |
69 | character (octal 0177) prints as ``^?''. | |
70 | Non-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 |
73 | The command ``cat file1 file2 > file3'' concatenates the contents of |
74 | file1 and file2 and places the result in file3. | |
e8cca28c | 75 | .PP |
ea642694 KB |
76 | Because of the shell language mechanism used to perform output |
77 | redirection, the command ``cat file1 file 2 > file1'' will cause | |
78 | the original data in file1 to be destroyed! | |
01ac33f9 KB |
79 | .PP |
80 | .I Cat | |
81 | exits 0 on success, >0 if an error occurred. | |
e8cca28c | 82 | .SH "SEE ALSO" |
ea642694 KB |
83 | head(1), more(1), pr(1), tail(1) |
84 | .br | |
85 | Rob Pike, ``UNIX Style, or cat -v Considered Harmful'' | |
86 | USENIX Summer Conference Proceedings, 1983. |