8447 uts: acpica_check_bios_date() instead of bios-free, use efi-systab
[unleashed.git] / bin / cat / cat.1
blob9e5e87b7153c7a661b6e008f564472081dade7bb
1 '\" te
2 .\"  Copyright 1989 AT&T Copyright (c)
3 .\" 2008, Sun Microsystems, Inc. All Rights Reserved
4 .\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
5 .\" Portions Copyright (c) 1982-2007 AT&T Knowledge Ventures
6 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
7 .\" http://www.opengroup.org/bookstore/.
8 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
9 .\"  This notice shall appear on any product containing this material.
10 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
11 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
12 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
13 .TH CAT 1 "Apr 8, 2008"
14 .SH NAME
15 cat \- concatenate and display files
16 .SH SYNOPSIS
17 .SS "\fB/usr/bin/cat\fR"
18 .LP
19 .nf
20 \fB/usr/bin/cat\fR [\fB-nbsuvet\fR] [\fIfile\fR...]
21 .fi
23 .SS "\fBksh93\fR"
24 .LP
25 .nf
26 \fBcat\fR [\fB-bdenstuvABDEST\fR] [\fIfile\fR...]
27 .fi
29 .SH DESCRIPTION
30 .SS "\fB/usr/bin/cat\fR"
31 .sp
32 .LP
33 The \fBcat\fR utility reads each \fIfile\fR in sequence and writes it on the
34 standard output. Thus:
35 .sp
36 .in +2
37 .nf
38 example% \fBcat file\fR
39 .fi
40 .in -2
41 .sp
43 .sp
44 .LP
45 prints \fIfile\fR on your terminal, and:
46 .sp
47 .in +2
48 .nf
49 example% \fBcat file1 file2 >file3\fR
50 .fi
51 .in -2
52 .sp
54 .sp
55 .LP
56 concatenates \fIfile1\fR and \fIfile2\fR, and writes the results in
57 \fIfile3\fR. If no input file is given, \fBcat\fR reads from the standard input
58 file.
59 .SS "\fBksh93\fR"
60 .sp
61 .LP
62 The \fBcat\fR built-in in \fBksh93\fR is associated with the \fB/bin\fR and
63 \fB/usr/bin\fR paths. It is invoked when \fBcat\fR is executed without a
64 pathname prefix and the pathname search finds a \fB/bin/cat\fR or
65 \fB/usr/bin/cat\fR executable. \fBcat\fR copies each file in sequence to the
66 standard output. If no file is specified, or if the file is \fB-\fR, \fBcat\fR
67 copies from standard input starting at the current location.
68 .SH OPTIONS
69 .SS "\fB/usr/bin/cat\fR"
70 .sp
71 .LP
72 The following options are supported by \fB/usr/bin/cat\fR:
73 .sp
74 .ne 2
75 .na
76 \fB\fB-b\fR\fR
77 .ad
78 .RS 6n
79 Number the lines, as \fB-n\fR, but omit the line numbers from blank lines.
80 .RE
82 .sp
83 .ne 2
84 .na
85 \fB\fB-n\fR\fR
86 .ad
87 .RS 6n
88 Precede each line output with its line number.
89 .RE
91 .sp
92 .ne 2
93 .na
94 \fB\fB-s\fR\fR
95 .ad
96 .RS 6n
97 \fBcat\fR is silent about non-existent files.
98 .RE
101 .ne 2
103 \fB\fB-u\fR\fR
105 .RS 6n
106 The output is not buffered.
108 Buffered output is the default.
112 .ne 2
114 \fB\fB-v\fR\fR
116 .RS 6n
117 Non-printing characters, with the exception of tabs, NEWLINEs and form feeds,
118 are printed visibly. ASCII control characters (octal \fB000\fR \(mi \fB037\fR)
119 are printed as \fB^\fR\fIn,\fR where \fIn\fR is the corresponding ASCII
120 character in the range octal 100 \(mi 137 (@, A, B, C, . . ., X, Y, Z, [, \e,
121 ], ^, and _); the \fBDEL\fR character (octal \fB0177\fR) is printed \fB^?\fR.
122 Other non-printable characters are printed as \fBM-\fR\fIx,\fR where \fIx\fR is
123 the ASCII character specified by the low-order seven bits.
128 When used with the \fB-v\fR option, the following options can be used:
130 .ne 2
132 \fB\fB-e\fR\fR
134 .RS 6n
135 A \fB$\fR character is printed at the end of each line, prior to the NEWLINE.
139 .ne 2
141 \fB\fB-t\fR\fR
143 .RS 6n
144 Tabs are printed as \fB^I\fRs and form feeds to be printed as \fB^L\fRs.
149 The \fB-e\fR and \fB-t\fR options are ignored if the \fB-v\fR option is not
150 specified.
151 .SS "\fBksh93\fR"
154 \fBksh93\fR \fBcat\fR supports the following options:
156 .ne 2
158 \fB\fB-b\fR \fB--number-nonblank\fR\fR
160 .RS 25n
161 Number lines as with \fB-n\fR but omit line numbers from blank lines.
165 .ne 2
167 \fB\fB-d\fR \fB--dos-input\fR\fR
169 .RS 25n
170 Open input files in text mode. Removes RETURNs in front of NEWLINEs on some
171 systems.
175 .ne 2
177 \fB\fB-e\fR\fR
179 .RS 25n
180 Equivalent to \fB-vE\fR.
184 .ne 2
186 \fB\fB-n\fR \fB--number\fR\fR
188 .RS 25n
189 Insert a line number at the beginning of each line.
193 .ne 2
195 \fB\fB-s\fR\fR
197 .RS 25n
198 Equivalent to \fB-S\fR for \fBatt universe\fR and \fB-B\fR otherwise.
202 .ne 2
204 \fB\fB-t\fR\fR
206 .RS 25n
207 Equivalent to \fB-vT\fR.
211 .ne 2
213 \fB\fB-u\fR \fB--unbuffer\fR\fR
215 .RS 25n
216 Do not delay the output by buffering.
220 .ne 2
222 \fB\fB-v\fR \fB--show-nonprinting\fR\fR
224 .RS 25n
225 Cause non-printing characters (with the exception of TABs, NEWLINEs, and form
226 feeds) to be output as printable character sequences. \fBASCII\fR control
227 characters are printed as \fB^n\fR, where \fIn\fR is the corresponding
228 \fBASCII\fR character in the range octal \fB100\fR-\fB137\fR. The DEL character
229 (octal \fB0177\fR) is copied as \fB^?\fR. Other non-printable characters are
230 copied as \fBM-\fR\fIx\fR where \fIx\fR is the \fBASCII\fR character specified
231 by the low-order seven bits. Multi-byte characters in the current locale are
232 treated as printable characters.
236 .ne 2
238 \fB\fB-A\fR \fB--show-all\fR\fR
240 .RS 25n
241 Equivalent to \fB-vET\fR.
245 .ne 2
247 \fB\fB-B\fR \fB--squeeze-blank\fR\fR
249 .RS 25n
250 Replace multiple adjacent NEWLINE characters with one NEWLINE.
254 .ne 2
256 \fB\fB-D\fR \fB--dos-output\fR\fR
258 .RS 25n
259 Open output files in text mode. Insert RETURNs in front of NEWLINEs on some
260 systems.
264 .ne 2
266 \fB\fB-E\fR \fB--show-ends\fR\fR
268 .RS 25n
269 Insert a \fB$\fR before each NEWLINE.
273 .ne 2
275 \fB\fB-S\fR \fB--silent\fR\fR
277 .RS 25n
278 \fBcat\fR is silent about non-existent files.
282 .ne 2
284 \fB\fB-T\fR \fB--show-blank\fR\fR
286 .RS 25n
287 Copies TABs as \fB^I\fR and form feeds as \fB^L\fR.
290 .SH OPERANDS
293 The following operand is supported:
295 .ne 2
297 \fB\fIfile\fR\fR
299 .RS 8n
300 A path name of an input file. If no \fIfile\fR is specified, the standard input
301 is used. If \fIfile\fR is \fB\|\(mi\|\fR, \fBcat\fR reads from the standard
302 input at that point in the sequence. \fBcat\fR does not close and reopen
303 standard input when it is referenced in this way, but accepts multiple
304 occurrences of \fB\|\(mi\|\fR as \fIfile\fR.
307 .SH USAGE
310 See \fBlargefile\fR(5) for the description of the behavior of \fBcat\fR when
311 encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
312 .SH EXAMPLES
314 \fBExample 1 \fRConcatenating a File
317 The following command writes the contents of the file \fBmyfile\fR to standard
318 output:
321 .in +2
323 example% \fBcat myfile\fR
325 .in -2
329 \fBExample 2 \fRConcatenating Two files into One
332 The following command concatenates the files \fBdoc1\fR and \fBdoc2\fR and
333 writes the result to \fBdoc.all\fR.
336 .in +2
338 example% \fBcat doc1 doc2 > doc.all\fR
340 .in -2
344 \fBExample 3 \fRConcatenating Two Arbitrary Pieces of Input with a Single
345 Invocation
348 When standard input is a terminal, the following command gets two arbitrary
349 pieces of input from the terminal with a single invocation of \fBcat\fR:
352 .in +2
354 example% \fBcat start - middle - end > file\fR
356 .in -2
361 when standard input is a terminal, gets two arbitrary pieces of input from the
362 terminal with a single invocation of \fBcat\fR.
366 If standard input is a regular file,
369 .in +2
371 example% \fBcat start - middle - end > file\fR
373 .in -2
378 would be equivalent to the following command:
381 .in +2
383 \fBcat start - middle /dev/null end > file\fR
385 .in -2
390 because the entire contents of the file would be consumed by \fBcat\fR the
391 first time \fB\|\(mi\|\fR was used as a \fIfile\fR operand and an end-of-file
392 condition would be detected immediately when \fB\|\(mi\|\fRwas referenced the
393 second time.
395 .SH ENVIRONMENT VARIABLES
398 See \fBenviron\fR(5) for descriptions of the following environment variables
399 that affect the execution of \fBcat\fR: \fBLANG\fR, \fBLC_ALL\fR,
400 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
401 .SH EXIT STATUS
404 The following exit values are returned:
406 .ne 2
408 \fB\fB0\fR\fR
410 .RS 6n
411 All input files were output successfully.
415 .ne 2
417 \fB\fB>0\fR\fR
419 .RS 6n
420 An error occurred.
423 .SH ATTRIBUTES
426 See \fBattributes\fR(5) for descriptions of the following attributes:
427 .SS "\fB/usr/bin/cat\fR"
432 box;
433 c | c
434 l | l .
435 ATTRIBUTE TYPE  ATTRIBUTE VALUE
437 CSI     Enabled
439 Interface Stability     Committed
441 Standard        See \fBstandards\fR(5).
444 .SS "\fBksh93\fR"
449 box;
450 c | c
451 l | l .
452 ATTRIBUTE TYPE  ATTRIBUTE VALUE
454 Interface Stability     See below.
459 The \fBksh93\fR built-in binding to \fB/bin\fR and \fB/usr/bin\fR is Volatile.
460 The built-in interfaces are Uncommitted.
461 .SH SEE ALSO
464 \fBtouch\fR(1), \fBattributes\fR(5), \fBenviron\fR(5), \fBlargefile\fR(5),
465 \fBstandards\fR(5)
466 .SH NOTES
469 Redirecting the output of \fBcat\fR onto one of the files being read causes the
470 loss of the data originally in the file being read. For example,
472 .in +2
474 example% \fBcat filename1 filename2 > filename1\fR
476 .in -2
481 causes the original data in \fBfilename1\fR to be lost.