1*63663Sbostic.\" Copyright (c) 1989, 1990, 1993 2*63663Sbostic.\" The Regents of the University of California. All rights reserved. 319079Smckusick.\" 450178Sbostic.\" This code is derived from software contributed to Berkeley by 550178Sbostic.\" the Institute of Electrical and Electronics Engineers, Inc. 650178Sbostic.\" 742525Sbostic.\" %sccs.include.redist.man% 819079Smckusick.\" 9*63663Sbostic.\" @(#)cat.1 8.1 (Berkeley) 06/29/93 1037129Sbostic.\" 1143082Scael.Dd 1243082Scael.Dt CAT 1 1343082Scael.Os BSD 3 1443082Scael.Sh NAME 1543082Scael.Nm cat 1643082Scael.Nd concatenate and print files 1743082Scael.Sh SYNOPSIS 1843082Scael.Nm cat 1943082Scael.Op Fl benstuv 2043082Scael.Op Fl 2147400Scael.Op Ar 2243082Scael.Sh DESCRIPTION 2337129SbosticThe 2443082Scael.Nm cat 2537129Sbosticutility reads files sequentially, writing them to the standard output. 2619080SmckusickThe 2743082Scael.Ar file 2837129Sbosticoperands are processed in command line order. 2963662SmckusickA single dash represents the standard input. 3043082Scael.Pp 3137180SbosticThe options are as follows: 3247400Scael.Bl -tag -width Ds 3347400Scael.It Fl b 3437180SbosticImplies the 3543082Scael.Fl n 3637180Sbosticoption but doesn't number blank lines. 3747400Scael.It Fl e 3837180SbosticImplies the 3943082Scael.Fl v 4047400Scaeloption, and displays a dollar sign 4147400Scael.Pq Ql \&$ 4247400Scaelat the end of each line 4337180Sbosticas well. 4447400Scael.It Fl n 4537180SbosticNumber the 4643082Scael.Ar output 4737180Sbosticlines, starting at 1. 4847400Scael.It Fl s 4937180SbosticSqueeze multiple adjacent empty lines, causing the output to be 5037180Sbosticsingle spaced. 5147400Scael.It Fl t 5237180SbosticImplies the 5343082Scael.Fl v 5447400Scaeloption, and displays tab characters as 5547400Scael.Pq Ql ^I 5647400Scaelas well. 5747400Scael.It Fl u 5819080SmckusickThe 5944952Scael.Fl u 6044952Scaeloption guarantees that the output is unbuffered. 6147400Scael.It Fl v 6237180SbosticDisplays non-printing characters so they are visible. 6363662SmckusickControl characters print as 6447400Scael.Ql ^X 6547400Scaelfor control-X; the delete 6647400Scaelcharacter (octal 0177) prints as 6747400Scael.Ql ^? 6837180SbosticNon-ascii characters (with the high bit set) are printed as 6947400Scael.Ql M- 7047400Scael(for meta) followed by the character for the low 7 bits. 7147400Scael.El 7243082Scael.Pp 7350063SbosticThe 7450063Sbostic.Nm cat 7550063Sbosticutility exits 0 on success, and >0 if an error occurs. 7650063Sbostic.Sh BUGS 7737129SbosticBecause of the shell language mechanism used to perform output 7847400Scaelredirection, the command 7947400Scael.Dq Li cat file1 file 2 > file1 8050063Sbosticwill cause the original data in file1 to be destroyed! 8143082Scael.Sh SEE ALSO 8243082Scael.Xr head 1 , 8343082Scael.Xr more 1 , 8443082Scael.Xr pr 1 , 8543082Scael.Xr tail 1 8647400Scael.Rs 8747400Scael.%A Rob Pike 8847400Scael.%T "UNIX Style, or cat -v Considered Harmful" 8947400Scael.%J "USENIX Summer Conference Proceedings" 9047400Scael.%D 1983 9147400Scael.Re 9243082Scael.Sh HISTORY 9347400ScaelA 9443082Scael.Nm 9547400Scaelcommand appeared in Version 6 AT&T UNIX. 96