p The word .Dq concatenate is just a verbose synonym for .Dq catenate .
p The options are as follows: l -tag -width Ds t Fl B Ar bsize Read with a buffer size of .Ar bsize bytes, instead of the default buffer size which is the blocksize of the output file. t Fl b Implies the .Fl n option, but doesn't number blank lines. t Fl e Implies the .Fl v option, and displays a dollar sign
q Ql $ at the end of each line as well. t Fl f Only attempt to display regular files. t Fl l Set an exclusive advisory lock on the standard output file descriptor. This lock is set using .Xr fcntl 2 with the .Dv F_SETLKW command. If the output file is already locked, .Nm will block until the lock is acquired. t Fl n Number the output lines, starting at 1. t Fl s Squeeze multiple adjacent empty lines, causing the output to be single spaced. t Fl t Implies the .Fl v option, and displays tab characters as .Ql ^I as well. t Fl u The .Fl u option guarantees that the output is unbuffered. t Fl v Displays non-printing characters so they are visible. Control characters print as .Ql ^X for control-X; the delete character (octal 0177) prints as .Ql ^? . Non-ascii characters (with the high bit set) are printed as .Ql M- (for meta) followed by the character for the low 7 bits. .El .Sh EXIT STATUS .Ex -std cat .Sh EXAMPLES The command: d -literal -offset indent c cat file1 .Ed
p will print the contents of .Ar file1 to the standard output.
p The command: d -literal -offset indent c cat file1 file2 > file3 .Ed
p will sequentially print the contents of .Ar file1 and .Ar file2 to the file .Ar file3 , truncating .Ar file3 if it already exists. See the manual page for your shell (e.g., .Xr sh 1 ) for more information on redirection.
p The command: d -literal -offset indent c cat file1 - file2 - file3 .Ed
p will print the contents of .Ar file1 , print data it receives from the standard input until it receives an .Dv EOF
q Sq ^D character, print the contents of .Ar file2 , read and output contents of the standard input again, then finally output the contents of .Ar file3 . Note that if the standard input referred to a file, the second dash on the command-line would have no effect, since the entire contents of the file would have already been read and printed by .Nm when it encountered the first .Ql - operand. .Sh SEE ALSO .Xr head 1 , .Xr hexdump 1 , .Xr lpr 1 , .Xr more 1 , .Xr pr 1 , .Xr tac 1 , .Xr tail 1 , .Xr view 1 , .Xr vis 1 , .Xr fcntl 2 .Rs .%A Rob Pike .%T "UNIX Style, or cat -v Considered Harmful" .%J "USENIX Summer Conference Proceedings" .%D 1983 .Re .Sh STANDARDS The .Nm utility is expected to conform to the .St -p1003.2-92 specification.
p The flags .Op Fl Bbeflnstv are extensions to the specification. .Sh HISTORY A .Nm utility appeared in .At v1 . Dennis Ritchie designed and wrote the first man page. It appears to have been .Xr cat 1 . .Sh BUGS Because of the shell language mechanism used to perform output redirection, the command .Dq Li cat file1 file2 > file1 will cause the original data in file1 to be destroyed! This is performed by the shell before .Nm is run.