Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/utilities/c/cat.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/utilities/c/cat.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/utilities/c/cat.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/utilities/c/cat.html on line 8

cat

Concatenate and print files (POSIX)

Syntax:

cat [-c] [-n|-r] [-u] [file...]

Runs on:

QNX Neutrino, Linux, Microsoft Windows

Options:

-c
Compress sequences of multiple newline characters into single newlines.
-n
Print line numbers, but don't restart the number for each new file.
-r
Print line numbers, restarting the number for each new file.
-u
Write unbuffered output. Data from the input file(s) is written to the standard output without delay as each file is read.
file
The pathname of an input file. If no files are specified, the standard input is used. If a file is the dash character (-), cat reads from the standard input at that point in the sequence.

Description:

The cat utility reads files in the order you specify and writes their contents to standard output.

Examples:

Write the contents of myfile to standard output:

cat myfile

Concatenate doc1 and doc2 and write the result to doc.all:

cat doc1 doc2 > doc.all

Exit status:

0
All input files were output successfully.
>0
An error occurred.

Caveats:

Because of the shell language mechanism used to perform output redirection, a command such as:

cat doc doc.end > doc

causes the original data in doc to be lost. The file doc is opened for write by the shell, and therefore truncated to zero length, before cat is executed.

See also:

cp, head, tail


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/utilities/c/cat.html on line 138

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/utilities/c/cat.html on line 138