gno/bin/tail/tail.1

145 lines
4.3 KiB
Groff
Raw Normal View History

.\" Copyright (c) 1980, 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" This code is derived from software contributed to Berkeley by
.\" the Institute of Electrical and Electronics Engineers, Inc.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by the University of
.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" @(#)tail.1 2.0 (GNO) 8/1/97
.\"
.TH TAIL 1 "August 1997" "GNO" "Commands and Applications"
.SH NAME
.BR tail
\- display the last part of a file
.SH SYNOPSIS
.BR tail
.RB [ -f ]
.RB [ -b
.IR number " |"
.B -c
.IR number " |"
.B -n
.IR number ]
.RI [ file ...]
.SS Obsolescent:
.BR tail "
.RB [ -f ]
.RB [ + | -\fInumber [ l
.RB "| " b " | " c ]]
.RI [ file ...]
.SH DESCRIPTION
The
.BR tail
utility displays the contents of
.BR file
or, by default, its standard input, to the standard output.
.LP
The display begins at a byte, line or 512-byte block location in the
input.
Numbers having a leading plus (``+'') sign are relative to the beginning
of the input, for example,
.B "-c +2"
starts the display at the second
byte of the input.
Numbers having a leading minus (``-'') sign or no explicit sign are
relative to the end of the input, for example,
.B "-n 2"
displays the last two lines of the input.
The default starting location is
.BR "-n 10" ,
or the last 10 lines of the input.
.LP
.SH OPTIONS
The options are as follows:
.RS
.IP \fB-b\fR \fInumber\fR
The location is
.IR number
512-byte blocks.
.IP \fB-c\fR \fInumber\fR
The location is
.IR number
bytes.
.IP \fB-f\fR
The
.B -f
option causes
.BR tail
not to stop when end of file is reached, but rather to wait for additional
data to be appended to the input.
The
.B -f
option is ignored if the standard input is a pipe, but not if it is a FIFO.
.IP \fB-n\fR \fInumber\fR
The location is
.IR number
lines.
.RE
.LP
If more than a single file is specified, each file is preceded by a
header consisting of the string
.B "==> XXX <=="
where
.B XXX
is the name of the file.
.LP
The
.BR tail
utility exits 0 on success, and >0 if an error occurs.
.SH ATTRIBUTIONS
This command was ported from FreeBSD source code
for distribution with GNO/ME 2.0.6.
.SH SEE ALSO
.BR cat (1),
.BR head (1),
.BR sed (1)
.SH STANDARDS
The
.BR tail
utility is expected to be a superset of the POSIX.2
specification.
In particular, the
.BR -b
option is an extension to that standard.
.LP
The historic (obsolescent) command line syntax of
.BR tail
is supported by this implementation.
.SH HISTORY
The BSD
.B -r
option, which causes the input to be displayed in reverse order, by line,
has not been implemented for the GNO version of
.BR tail .
.PP
Version 1.1 (18-Jan-93) of
.BR tail ,
shipped with GNO 2.0, was written by Sameer Parekh (zane@ddsw1.MCS.COM).