-   -
-   Home Page Field Missions Engineering More Info [MAP Menu]

cat

concatenate and print files

Syntax:

cat [-c] [-u] [file...]

Options:

-c
Compress each sequence of multiple newline characters into a single newline character.

Examples:

Write the contents of the file myfile to the standard output:

cat myfile

Description:

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

Exit status:

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

Files:

The cat utility writes the contents of the files named on the command line (which may include the standard input) to the standard output.

If an error is encountered (e.g. in attempting to open or read a file), a diagnostic message will be written to the standard error.

See also:

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 would be opened for write by the shell, and therefore truncated to zero length, before cat was executed.


last updated: Mon Sep 30 14:59:38 2002 webmaster@huarp.harvard.edu
Copyright 2002 by the President and Fellows of Harvard College
[Home] [People] [More Info] [Research Areas] [Field Missions] [Engineering]