CAT(1V)

NAME
cat - concatenate files

SYNOPSIS
cat [-s] [-v [-u] [-t] [-e] [-8]] [ - | file ] ...

DESCRIPTION
Cat reads each file in sequence and writes it to the standard output. The file name - causes the standard input to be read - it may be specified more than once on the command line. The standard input is also read if no file names are given.

OPTIONS

-s  Only output error messages if the close of an input file fails - no other error messages are output. (The error message output when a close fails is probably a bug in the original source code but is retained for compatibility). Compare with the -s option of cat(1) which removes repeated blank lines from the output.

-v  Make control characters visible. Control characters in the range 0-31 (decimal) and 128-159 are printed as ^ followed by the corresponding character in the range 64 (@) to 95 (_). The DEL character (127 decimal) is displayed as ^?. There is no way to distinguish top-bit set control characters from those without the top-bit set. The tab (^I) newline (^J) and form-feed (^L) characters are passed though unchanged (but see below). Non-control characters with the top bit set (in the range 160-255) are displayed preceded by the two characters “M-”.

The remaining options only have an effect if -v is specified.

-u  Output the characters without any buffering - each character is written individually to the output stream.

-t  Output tab and form-feed characters as ^I and ^L respectively.

-e  Precede newline characters with a “$” character.

-8  Do not precede top bit set (non-control) characters with “M-”.

If -v is not specified the output buffering is determined by the way the operating system buffers the input. Input and output will occur in units of at most BUFSIZ (see the include file /usr/include/stdio.h). Input from terminals or pipes will probably be handled in smaller units - the operating system line buffers terminal input. If -v is specified and -u is not given the buffering will be the default for the output stream - this will depend on the filing system if the output is to a file. Line buffering will be used for output to terminals.

SEE ALSO
cat(1), cp(1), more(1), pr(1v), tail(1).

BUGS
This command is provided for compatibility with the corresponding System V command. This command has several undesirable features:

    -s removes all error messages but one.

    -v outputs top bit set characters without change (although it precedes them with “M-”). This can cause problems on some terminals if the terminal line driver passes these characters without change. If the top bit is removed character 255 will typically be displayed as “M” or “M-” (M-<DEL>).

    Top bit set control characters cannot be distinguished from the non top bit set versions when using -v.

    The -u option only works with -v.