.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "TAIL 1" .TH TAIL 1 "2001-06-06" "perl v5.20.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" tail \- display the last part of a file .PP xtail \- watch the growth of files .SH "SYNOPSIS" .IX Header "SYNOPSIS" tail [\fB\-f\fR | \fB\-r\fR] [\fB\-b number\fR | \fB\-c number\fR | \fB\-n number\fR | \&\fB[\-+]number\fR] [\fBfile\fR...] .PP xtail [\fB\-h\fR] file ... .SH "DESCRIPTION" .IX Header "DESCRIPTION" The \fItail\fR utility displays the contents of \fBfile\fR or, by default, its standard input, to the standard output. .PP The display begins at a byte, line or 512\-byte block location in the input. Numbers having a leading plus (\fB+\fR) sign are relative to the beginning of the input, for example, \fB\-c +2\fR starts the display at the second byte of the input. Numbers having a leading minus (\fB\-\fR) sign or no explicit sign are relative to the end of the input, for example, \fB\-n 2\fR displays the last two lines of the input. The default starting location is \fB\-n 10\fR, or the last 10 lines of the input. .PP The \fIxtail\fR utility monitors one or more files, and displays all data written to a file since command invocation. It is very useful for monitoring multiple logfiles simultaneously. It may be invoked by renaming \fItail\fR to \fIxtail\fR, or by calling \fItail\fR with the \fB\-f\fR option. .PP With \fIxtail\fR or \fItail \-f\fR, if an entry given on the command line is a directory, all files in that directory will be monitored, including those created after the invocation. If an entry given on the command line doesn't exist, the program will watch for it and monitor it once created. When switching files in the display, a banner showing the pathname of the file is printed. .PP An interrupt character (usually \s-1CTRL/C\s0 or \s-1DEL\s0) will display a list of the most recently modified files being watched. Send a quit signal (usually CTRL/backslash) to stop the program. .PP The options are the following for \fItail\fR (only the \fB\-h\fR option is supported by \fIxtail\fR) : .IP "\fB\-b number\fR" 4 .IX Item "-b number" The location is \fBnumber\fR 512\-byte blocks. .IP "\fB\-c number\fR" 4 .IX Item "-c number" The location is \fBnumber\fR bytes. .IP "\fB\-f\fR" 4 .IX Item "-f" The \fB\-f\fR option causes \fItail\fR to not stop when end-of-file is reached, but rather to wait for additional data to be appended to the input. If the file is replaced (ie. the inode number changes), \fItail\fR will reopen the file and continue. If the file is truncated, \fItail\fR will reset its position back to the beginning. This makes \fItail\fR more useful for watching log files that may get rotated. The \fB\-f\fR option is ignored if the standard input is a pipe, but not if it is a \s-1FIFO.\s0 .IP "\fB\-h\fR" 4 .IX Item "-h" Displays a short usage message. .IP "\fB\-n\fR number" 4 .IX Item "-n number" The location is \fBnumber\fR lines. .IP "\fB\-r\fR" 4 .IX Item "-r" The \fB\-r\fR option causes the input to be displayed in reverse order, by line. Additionally, this option changes the meaning of the \fB\-b\fR, \&\fB\-c\fR and \fB\-n\fR options. When the \fB\-r\fR 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 \&\fB\-r\fR option is to display all of the input. .IP "\fB\-ddd\fR where \fBddd\fR is an integer" 4 .IX Item "-ddd where ddd is an integer" Same as \fB\-n ddd\fR. .PP If more than a single file is specified, each file is preceded by a header consisting of the string ``*** \s-1XXX\s0 ***'' where ``\s-1XXX\s0'' is the name of the file. .PP This header also appears with the \fB\-f\fR option, when the file inode has changed. .PP The \fItail\fR utility exits 0 on success or >0 if an error occurred. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIcat\fR\|(1), \fIhead\fR\|(1), \fIsed\fR\|(1) .SH "STANDARDS" .IX Header "STANDARDS" The \fItail\fR utility is expected to be a superset of the \s-1IEEE\s0 Std1003.2\-1992 (``\s-1POSIX.2\s0'') specification. In particular, the \fB\-b\fR and \fB\-r\fR options are extensions to that standard. .PP The historic command line syntax of \fItail\fR is supported by this implementation. The only difference between this implementation and historic versions of \fItail\fR, once the command line syntax translation has been done, is that the \fB\-b\fR, \fB\-c\fR and \fB\-n\fR options modify the \&\-r option, i.e. \fB\-r \-c 4\fR displays the last 4 characters of the last line of the input, while the historic \fItail\fR (using the historic syntax \&\fB\-4cr\fR) would ignore the \fB\-c\fR option and display the last 4 lines of the input. .SH "HISTORY" .IX Header "HISTORY" A \fItail\fR command appeared in Version 7 \s-1AT&T UNIX.\s0 .PP The original version of \fIxtail\fR was written by Chip Rosenthal. .SH "BUGS" .IX Header "BUGS" This implementation of \fItail\fR and \fIxtail\fR has no known bugs. However it has not been completely tested on all systems (yet). .SH "NOTES" .IX Header "NOTES" The \fIxtail\fR implementation opens and reopens file handles very often. It works pretty well on my system, but tell me if you have problems monitoring directories with hundreds of log files which vary very often. .PP Since \fItail \-f\fR or \fIxtail\fR catches the \s-1INT\s0 signals (CTRL-C), the program must be stopped a \s-1QUIT\s0 signal (CTRL-D) or by some other means, for instance CTRL-Pause on Windows. .SH "AUTHOR" .IX Header "AUTHOR" The Perl implementation was written by Thierry Bezecourt, \&\fIthbzcrt@worldnet.fr\fR. Perl Power Tools project, March 1999. .PP This documentation comes from the \s-1BSD\s0 \fItail\fR\|(1) man page and from the xtail man page. The integration of xtail was Tom Christiansen's idea. .SH "COPYRIGHT and LICENSE" .IX Header "COPYRIGHT and LICENSE" This program is free and open software. You may use, modify, distribute, and sell this program (and any modified variants) in any way you wish, provided you do not restrict others from doing the same.