Print this page
3484 enhance and document tail follow support
Reviewed by: Joshua M. Clulow <jmc@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/man/man1/tail.1
          +++ new/usr/src/man/man1/tail.1
   1    1  '\" te
   2    2  .\"  Copyright 1989 AT&T  Copyright (c) 1992, X/Open Company Limited  All Rights Reserved  Portions Copyright (c) 2005, Sun Microsystems, Inc.  All Rights Reserved
   3    3  .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
   4    4  .\" http://www.opengroup.org/bookstore/.
   5    5  .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
   6    6  .\"  This notice shall appear on any product containing this material.
   7    7  .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
   8    8  .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
   9    9  .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
  10      -.TH TAIL 1 "Jul 13, 2005"
       10 +.\" Copyright (c) 2013, Joyent, Inc. All Rights Reserved.
       11 +.TH TAIL 1 "Jan 18, 2013"
  11   12  .SH NAME
  12   13  tail \- deliver the last part of a file
  13   14  .SH SYNOPSIS
  14   15  .LP
  15   16  .nf
  16   17  \fB/usr/bin/tail\fR [\(+-s \fInumber\fR [lbcr]] [\fIfile\fR]
  17   18  .fi
  18   19  
  19   20  .LP
  20   21  .nf
  21   22  \fB/usr/bin/tail\fR [\fB-lbcr\fR] [\fIfile\fR]
  22   23  .fi
  23   24  
  24   25  .LP
  25   26  .nf
  26      -\fB/usr/bin/tail\fR [\(+- \fInumber\fR [lbcf]] [\fIfile\fR]
       27 +\fB/usr/bin/tail\fR [\(+- \fInumber\fR [lbcfF]] [\fIfile\fR]
  27   28  .fi
  28   29  
  29   30  .LP
  30   31  .nf
  31      -\fB/usr/bin/tail\fR [\fB-lbcf\fR] [\fIfile\fR]
       32 +\fB/usr/bin/tail\fR [\fB-lbcfF\fR] [\fIfile\fR]
  32   33  .fi
  33   34  
  34   35  .LP
  35   36  .nf
  36   37  \fB/usr/xpg4/bin/tail\fR [\fB-f\fR | \fB-r\fR] [\fB-c\fR \fInumber\fR | \fB-n\fR \fInumber\fR] [\fIfile\fR]
  37   38  .fi
  38   39  
  39   40  .LP
  40   41  .nf
  41   42  \fB/usr/xpg4/bin/tail\fR [\(+- \fInumber\fR [l | b | c] [f]] [\fIfile\fR]
↓ open down ↓ 43 lines elided ↑ open up ↑
  85   86  .RS 7n
  86   87  Units of bytes.
  87   88  .RE
  88   89  
  89   90  .sp
  90   91  .ne 2
  91   92  .na
  92   93  \fB\fB-f\fR \fR
  93   94  .ad
  94   95  .RS 7n
  95      -Follow. If the input-file is not a pipe, the program does not terminate after
  96      -the line of the input-file has been copied, but enters an endless loop, wherein
  97      -it sleeps for a second and then attempts to read and copy further records from
  98      -the input-file. Thus it can be used to monitor the growth of a file that is
  99      -being written by some other process.
       96 +Follow. If the input-file is not a pipe, \fBtail\fR does not terminate after
       97 +the last line of the input-file has been copied, but enters an endless loop,
       98 +wherein it watches the file for modifications and attempts to read and copy
       99 +further records from the input-file. Thus it can be used to monitor the growth
      100 +of a file that is being written by some other process. If the watched file is
      101 +truncated \fBtail\fR will begin reading records from the start of the file.
 100  102  .RE
 101  103  
      104 +.sp
      105 +.ne 2
      106 +.na
      107 +\fB\fB-F\fR \fR
      108 +.ad
      109 +.RS 7n
      110 +Follow named file. Operates as with \fB-f\fR, except that if the file is moved
      111 +(e.g. if a watched log file is rotated) \fBtail\fR will close the original file
      112 +and begin reading records from the start of the file with the specified name
      113 +if and when that file is recreated.
      114 +.RE
      115 +
 102  116  .sp
 103  117  .ne 2
 104  118  .na
 105  119  \fB\fB-l\fR \fR
 106  120  .ad
 107  121  .RS 7n
 108  122  Units of lines.
 109  123  .RE
 110  124  
 111  125  .sp
↓ open down ↓ 185 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX