'\"macro stdmacro
.if n .pH g1.tail @(#)tail	40.8 of 10/10/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} tail 1 "Directory and File Management Utilities" "\&"
.if \nX=1 .ds x} tail 1 "Directory and File Management Utilities"
.if \nX=2 .ds x} tail 1 "" "\&"
.if \nX=3 .ds x} tail "" "" "\&"
.TH \*(x}
.SH NAME
\f4tail\f1 \- deliver the last part of a file
.SH SYNOPSIS
\f4tail\f1
[ \f4\(+-\f1 \f2number\f1 \f4lbcr\f1 ] [ \f2file\f1 ]
.br
\f4tail\f1
[ \f4\-lbcr\f1 ] [ \f2file\f1 ]
.br
\f4tail\f1
[ \f4\(+-\f1 \f2number\f1 \f4lbcf\f1 ] [ \f2file\f1 ]
.br
\f4tail\f1
[ \f4\-lbcf\f1 ] [ \f2file\f1 ]
.SH DESCRIPTION
\f4tail\fP
copies the named file to the standard output beginning
at a designated place.
If no file is named, the standard input is used.
.PP
Copying begins at distance
\f4+\f2number\^\f1
from the beginning, or
\f4\-\f2number\^\f1
from the end of the input
(if
.I number\^
is null, the value 10 is assumed).
.I Number\^
is counted in units of lines, blocks, or characters,
according to the appended option
\f4l\f1,
\f4b\f1,
or
\f4c\f1.
When no units are specified, counting is by lines.
.PP
With the
\f4\-f\f1
(follow) option, if the input file is not a pipe,
the program will not terminate after the line of the input
file has been copied, but will enter an endless loop, wherein it
sleeps for a second and then attempts to read and copy
further records from the input file.
Thus it may be used to monitor the growth of a file that is
being written by some other process.
For example, the command:
.PP
.RS
\f4tail \|\-f \|fred\fP
.RE
.PP
will print the last ten lines of the file
\f4fred\f1,
followed by any lines that are appended to
\f4fred\^\f1
between the time
\f4tail\fP
is initiated and killed.
As another example, the command:
.PP
.RS
\f4tail \|\-15cf \|fred\fP
.RE
.PP
will print the last 15 characters of the file
\f4fred\f1,
followed by any lines that are appended to
\f4fred\^\f1
between the time
\f4tail\fP
is initiated and killed.
.PP
The
\f4r\f1
option copies lines from the specified starting
point in the file in reverse order.
The default for
\f4r\f1
is to print the entire file in reverse order.
.PP
The
\f4r\f1
and 
\f4f\f1
options are mutually exclusive.
.SH SEE ALSO
\f4cat\fP(1),
\f4head\fP(1),
\f4more\fP(1),
\f4pg\fP(1),
\f4tail\fP(1).
.sp .2
\f4dd\fP(1M) in the \f2System Administrator's Reference Manual\f1.
.SH NOTES
Tails relative to the end of the file
are stored in a buffer, and thus
are limited in length.
Various kinds of anomalous behavior may happen
with character special files.
.P
The \f4tail\fP command will only tail the last 4096 bytes
of a file regardless of its line count.
.\"	@(#)tail.1	6.2 of 9/2/83
.Ee
