ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzahz_5.4.0.1/tail.htm

122 lines
3.6 KiB
HTML
Raw Permalink Normal View History

2024-04-02 14:02:31 +00:00
<!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>tail - Display the last part of a file</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>tail - Display the last part of a file</h2>
<strong>Synopsis</strong>
<p><strong>tail [-f | -r] [-b</strong> <em>number</em> <strong>|
-c</strong> <em>number</em> <strong>| -k</strong> <em>number</em> <strong>|-n</strong> <em>
number</em><strong>]</strong> [<em>file</em> ...]</p>
<p><strong>Description</strong></p>
<p>The <strong>tail</strong> utility displays the contents of <em>
file</em> or, by default, standard input, to the standard
output.</p>
<p>The display begins at a byte, line, 512-byte block, or kilobyte location in
the input. <em>Numbers</em> having a leading plus sign (+) are
relative to the beginning of the input, for example, "-c +2" starts
the display at the second byte of the input. <em>Numbers</em>
having a leading minus sign (-) or no explicit sign are relative to
the end of the input, for example, "-n 2" displays the last two
lines of the input. The default starting location is "-n 10", or
the last 10 lines of the input.</p>
<p>If more than one <em>file</em> is specified, each file is
preceded by a header consisting of the string "==&gt; XXX &lt;=="
where XXX is the name of the file.</p>
<table>
<tr>
<td><strong>Note:</strong></td>
<td><strong>tail</strong> does not support large files (files
greater than 2GB in size).</td>
</tr>
</table>
<p><strong>Options</strong></p>
<dl>
<dt><strong>-b</strong> <em>number</em></dt>
<dd>The location is <em>number</em> 512-byte blocks.</dd>
<dt><strong>-c</strong> <em>number</em></dt>
<dd>The location is <em>number</em> bytes.</dd>
<dt><strong>-f</strong></dt>
<dd>Causes <strong>tail</strong> to not stop when end of file is
reached, but rather to wait for additional data to be appended to
the input. The <strong>-f</strong> option is ignored if the
standard input is a pipe, but not if it is a FIFO.</dd>
<dt><strong>-k</strong> <em>number</em></dt>
<dd>The location is <em>number</em> kilobytes.</dd>
<dt><strong>-n</strong> <em>number</em></dt>
<dd>The location is <em>number</em> lines.</dd>
<dt><strong>-r</strong></dt>
<dd>Causes the input to be displayed in reverse order, by line.
Additionally, this option changes the meaning of the <strong>
-b</strong>, <strong>-c</strong> and <strong>-n</strong> options.
When the <strong>-r</strong> option is specified, these options
specify the number of bytes, lines or 512-byte blocks to display,
instead of the bytes, lines or blocks from the beginning or end of
the input from which to begin the display. The default for the
<strong>-r</strong> option is to display all of the input.</dd>
</dl>
<p><strong>Exit Status</strong></p>
<ul>
<li>0 on success</li>
<li>&gt;0 if an error occurs</li>
</ul>
<p><strong>Related information</strong></p>
<ul>
<li><a href="cat.htm">cat - Concatenate and print files</a></li>
<li><a href="head.htm">head - Copy the first part of files</a></li>
</ul>
<strong>Examples</strong>
<ol>
<li>Display the last 100 lines from the file "donkeys". If the
file "donkeys" is less than 100 lines, then <strong>tail</strong>
displays the entire file.
<pre>
tail -n 100 donkeys
</pre>
</li>
</ol>
<!-- end ibmbody========================================================= -->
</body>
</html>