Print this page
3484 enhance and document tail follow support
Reviewed by: Joshua M. Clulow <jmc@joyent.com>
   1 '\" te
   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 .\" 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 .\" http://www.opengroup.org/bookstore/.
   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 .\"  This notice shall appear on any product containing this material.
   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 .\" 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 .\" 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"

  11 .SH NAME
  12 tail \- deliver the last part of a file
  13 .SH SYNOPSIS
  14 .LP
  15 .nf
  16 \fB/usr/bin/tail\fR [\(+-s \fInumber\fR [lbcr]] [\fIfile\fR]
  17 .fi
  18 
  19 .LP
  20 .nf
  21 \fB/usr/bin/tail\fR [\fB-lbcr\fR] [\fIfile\fR]
  22 .fi
  23 
  24 .LP
  25 .nf
  26 \fB/usr/bin/tail\fR [\(+- \fInumber\fR [lbcf]] [\fIfile\fR]
  27 .fi
  28 
  29 .LP
  30 .nf
  31 \fB/usr/bin/tail\fR [\fB-lbcf\fR] [\fIfile\fR]
  32 .fi
  33 
  34 .LP
  35 .nf
  36 \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 .fi
  38 
  39 .LP
  40 .nf
  41 \fB/usr/xpg4/bin/tail\fR [\(+- \fInumber\fR [l | b | c] [f]] [\fIfile\fR]
  42 .fi
  43 
  44 .LP
  45 .nf
  46 \fB/usr/xpg4/bin/tail\fR [\(+- \fInumber\fR [l] [f | r]] [\fIfile\fR]
  47 .fi
  48 
  49 .SH DESCRIPTION
  50 .sp
  51 .LP


  75 .ad
  76 .RS 7n
  77 Units of blocks.
  78 .RE
  79 
  80 .sp
  81 .ne 2
  82 .na
  83 \fB\fB-c\fR \fR
  84 .ad
  85 .RS 7n
  86 Units of bytes.
  87 .RE
  88 
  89 .sp
  90 .ne 2
  91 .na
  92 \fB\fB-f\fR \fR
  93 .ad
  94 .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.

 100 .RE
 101 












 102 .sp
 103 .ne 2
 104 .na
 105 \fB\fB-l\fR \fR
 106 .ad
 107 .RS 7n
 108 Units of lines.
 109 .RE
 110 
 111 .sp
 112 .ne 2
 113 .na
 114 \fB\fB-r\fR \fR
 115 .ad
 116 .RS 7n
 117 Reverse. Copies lines from the specified starting point in the file in reverse
 118 order. The default for \fBr\fR is to print the entire file in reverse order.
 119 .RE
 120 
 121 .SS "/usr/xpg4/bin/tail"


   1 '\" te
   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 .\" 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 .\" http://www.opengroup.org/bookstore/.
   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 .\"  This notice shall appear on any product containing this material.
   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 .\" 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 .\" 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 .\" Copyright (c) 2013, Joyent, Inc. All Rights Reserved.
  11 .TH TAIL 1 "Jan 18, 2013"
  12 .SH NAME
  13 tail \- deliver the last part of a file
  14 .SH SYNOPSIS
  15 .LP
  16 .nf
  17 \fB/usr/bin/tail\fR [\(+-s \fInumber\fR [lbcr]] [\fIfile\fR]
  18 .fi
  19 
  20 .LP
  21 .nf
  22 \fB/usr/bin/tail\fR [\fB-lbcr\fR] [\fIfile\fR]
  23 .fi
  24 
  25 .LP
  26 .nf
  27 \fB/usr/bin/tail\fR [\(+- \fInumber\fR [lbcfF]] [\fIfile\fR]
  28 .fi
  29 
  30 .LP
  31 .nf
  32 \fB/usr/bin/tail\fR [\fB-lbcfF\fR] [\fIfile\fR]
  33 .fi
  34 
  35 .LP
  36 .nf
  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]
  38 .fi
  39 
  40 .LP
  41 .nf
  42 \fB/usr/xpg4/bin/tail\fR [\(+- \fInumber\fR [l | b | c] [f]] [\fIfile\fR]
  43 .fi
  44 
  45 .LP
  46 .nf
  47 \fB/usr/xpg4/bin/tail\fR [\(+- \fInumber\fR [l] [f | r]] [\fIfile\fR]
  48 .fi
  49 
  50 .SH DESCRIPTION
  51 .sp
  52 .LP


  76 .ad
  77 .RS 7n
  78 Units of blocks.
  79 .RE
  80 
  81 .sp
  82 .ne 2
  83 .na
  84 \fB\fB-c\fR \fR
  85 .ad
  86 .RS 7n
  87 Units of bytes.
  88 .RE
  89 
  90 .sp
  91 .ne 2
  92 .na
  93 \fB\fB-f\fR \fR
  94 .ad
  95 .RS 7n
  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.
 102 .RE
 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 
 116 .sp
 117 .ne 2
 118 .na
 119 \fB\fB-l\fR \fR
 120 .ad
 121 .RS 7n
 122 Units of lines.
 123 .RE
 124 
 125 .sp
 126 .ne 2
 127 .na
 128 \fB\fB-r\fR \fR
 129 .ad
 130 .RS 7n
 131 Reverse. Copies lines from the specified starting point in the file in reverse
 132 order. The default for \fBr\fR is to print the entire file in reverse order.
 133 .RE
 134 
 135 .SS "/usr/xpg4/bin/tail"