163663Sbostic.\" Copyright (c) 1989, 1990, 1993 263663Sbostic.\" 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*69175Smckusick.\" @(#)cat.1 8.3 (Berkeley) 05/02/95 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 4567883SmckusickNumber the output lines, starting at 1. 4647400Scael.It Fl s 4737180SbosticSqueeze multiple adjacent empty lines, causing the output to be 4837180Sbosticsingle spaced. 4947400Scael.It Fl t 5037180SbosticImplies the 5143082Scael.Fl v 5247400Scaeloption, and displays tab characters as 5367883Smckusick.Ql ^I 5447400Scaelas well. 5547400Scael.It Fl u 5619080SmckusickThe 5744952Scael.Fl u 5844952Scaeloption guarantees that the output is unbuffered. 5947400Scael.It Fl v 6037180SbosticDisplays non-printing characters so they are visible. 6163662SmckusickControl characters print as 6247400Scael.Ql ^X 6347400Scaelfor control-X; the delete 6447400Scaelcharacter (octal 0177) prints as 6547400Scael.Ql ^? 6637180SbosticNon-ascii characters (with the high bit set) are printed as 6747400Scael.Ql M- 6847400Scael(for meta) followed by the character for the low 7 bits. 6947400Scael.El 7043082Scael.Pp 7150063SbosticThe 7250063Sbostic.Nm cat 7350063Sbosticutility exits 0 on success, and >0 if an error occurs. 7450063Sbostic.Sh BUGS 7537129SbosticBecause of the shell language mechanism used to perform output 7647400Scaelredirection, the command 7747400Scael.Dq Li cat file1 file 2 > file1 7850063Sbosticwill cause the original data in file1 to be destroyed! 7943082Scael.Sh SEE ALSO 8043082Scael.Xr head 1 , 8143082Scael.Xr more 1 , 8243082Scael.Xr pr 1 , 83*69175Smckusick.Xr tail 1 , 84*69175Smckusick.Xr vis 1 8547400Scael.Rs 8647400Scael.%A Rob Pike 8747400Scael.%T "UNIX Style, or cat -v Considered Harmful" 8847400Scael.%J "USENIX Summer Conference Proceedings" 8947400Scael.%D 1983 9047400Scael.Re 9143082Scael.Sh HISTORY 9247400ScaelA 9343082Scael.Nm 9447400Scaelcommand appeared in Version 6 AT&T UNIX. 95