128 lines
3.2 KiB
HTML
128 lines
3.2 KiB
HTML
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||
|
<html>
|
||
|
<head>
|
||
|
<meta name="generator" content="HTML Tidy, see www.w3.org">
|
||
|
<meta http-equiv="Content-Type" content=
|
||
|
"text/html; charset=utf-8">
|
||
|
<title>cat - Concatenate and print files</title>
|
||
|
<LINK rel="stylesheet" type="text/css" href="../rzahg/ic.css">
|
||
|
</HEAD>
|
||
|
<body bgcolor="#FFFFFF">
|
||
|
<!-- Java sync-link -->
|
||
|
<SCRIPT LANGUAGE="Javascript" SRC="../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
|
||
|
|
||
|
|
||
|
|
||
|
<h2>cat - Concatenate and print files</h2>
|
||
|
|
||
|
<strong>Synopsis</strong>
|
||
|
|
||
|
<p><strong>cat [-bcensStuv] [-]</strong> [<em>file</em> ...]</p>
|
||
|
|
||
|
<p><strong>Description</strong></p>
|
||
|
|
||
|
<p>The <strong>cat</strong> utility reads the specified <em>
|
||
|
files</em> sequentially, writing them to standard output. The file
|
||
|
operands are processed in command line order. A single dash
|
||
|
represents standard input.</p>
|
||
|
|
||
|
<p>By default, <strong>cat</strong> reads <em>file</em> as text
|
||
|
data so the data is translated from the CCSID of the file. When the
|
||
|
<strong>-c</strong> option is specified, <strong>cat</strong> reads
|
||
|
the file as binary data.</p>
|
||
|
|
||
|
<p>Note that because of the shell language mechanism used to
|
||
|
perform output redirection, the command <tt><strong>cat</strong>
|
||
|
file1 file2 > file2</tt> will cause the original data in file2
|
||
|
to be destroyed. Also, the process will go into an infinite
|
||
|
loop.</p>
|
||
|
|
||
|
<p><strong>Options</strong></p>
|
||
|
|
||
|
<dl>
|
||
|
<dt><strong>-b</strong></dt>
|
||
|
|
||
|
<dd>Number the output lines but do not number blank lines.</dd>
|
||
|
|
||
|
<dt><strong>-c</strong></dt>
|
||
|
|
||
|
<dd>Do not convert the data as it is read.</dd>
|
||
|
|
||
|
<dt><strong>-e</strong></dt>
|
||
|
|
||
|
<dd>Number the output lines and display a dollar sign ($) at the
|
||
|
end of each line as well.</dd>
|
||
|
|
||
|
<dt><strong>-n</strong></dt>
|
||
|
|
||
|
<dd>Number the output lines, starting at 1.</dd>
|
||
|
|
||
|
<dt><strong>-s</strong></dt>
|
||
|
|
||
|
<dd>Squeeze multiple adjacent empty lines, causing the output to be
|
||
|
single spaced.</dd>
|
||
|
|
||
|
<dt><strong>-S</strong></dt>
|
||
|
|
||
|
<dd>Squeeze multiple adjacent empty lines, causing the output to be
|
||
|
single spaced.</dd>
|
||
|
|
||
|
<dt><strong>-t</strong></dt>
|
||
|
|
||
|
<dd>Display non-printing characters so they are visible like the
|
||
|
<strong>-v</strong> option and display tab characters as well.</dd>
|
||
|
|
||
|
<dt><strong>-u</strong></dt>
|
||
|
|
||
|
<dd>Guarantee that the output is unbuffered.</dd>
|
||
|
|
||
|
<dt><strong>-v</strong></dt>
|
||
|
|
||
|
<dd>Display non-printing characters so they are visible. A control
|
||
|
character prints as "^X" (for control). The delete character prints
|
||
|
as "^?". A non-display character prints as "M-x" (for meta). Note
|
||
|
that in most locales, all of the characters are displayable.</dd>
|
||
|
</dl>
|
||
|
|
||
|
<p><strong>Exit Status</strong></p>
|
||
|
|
||
|
<ul>
|
||
|
<li>0 when successful.</li>
|
||
|
|
||
|
<li>>0 when an error occurred.</li>
|
||
|
</ul>
|
||
|
|
||
|
<p><strong>Related information</strong></p>
|
||
|
|
||
|
<ul>
|
||
|
<li><a href="head.htm">head - Copy the first part of files</a></li>
|
||
|
|
||
|
<li><a href="tail.htm">tail - Copy the last part of a file</a></li>
|
||
|
|
||
|
<li><a href="zcat.htm">zcat - Expand and concatenate data</a></li>
|
||
|
</ul>
|
||
|
|
||
|
<strong>Examples</strong>
|
||
|
|
||
|
<ol>
|
||
|
<li>Display the contents of file, "myfile".
|
||
|
|
||
|
<pre>
|
||
|
cat myfile
|
||
|
</pre>
|
||
|
</li>
|
||
|
|
||
|
<li>Display the contents of three different files at the same time
|
||
|
and save their contents into a new file.
|
||
|
|
||
|
<pre>
|
||
|
cat file1 file2 file3 > all.files
|
||
|
</pre>
|
||
|
</li>
|
||
|
</ol>
|
||
|
|
||
|
<!-- end ibmbody========================================================= -->
|
||
|
</body>
|
||
|
</html>
|
||
|
|