.\" You may copy, distribute and modify under the terms of the LDP General .\" Public License as specified in the LICENSE file that comes with the .\" gnumaniak distribution .\" .\" The author kindly requests that no comments regarding the "better" .\" suitability or up-to-date notices of any info documentation alternative .\" is added without contacting him first. .\" .\" (C) 1999 Ragnar Hojland Espinosa .\" .\" GNU tail man page .\" man pages are NOT obsolete! .\" .TH TAIL 1 "15 August 1999" "GNU textutils 2.0" .SH NAME \fBtail\fR \- output the last part of files .SH SYNOPSIS .B tail [<\fB\-\fR|\fB+\fR>\fICOUNTOPTIONS\fR] [\fB\-fqv\fR] [\fB\-c \fIBYTES\fR] [\fB\-n \fILINES\fR] [\fB\-\-follow\fR] [\fB\-\-bytes=\fIBYTES\fR] [\fB\-\-lines=\fILINES\fR] [\fB\-\-follow\fR[\fB=\fIHOW\fR]] [\fB\-\-max\-consecutive\-size\-changes=\fINUMBER\fR] [\fB\-\-max\-unchanged\-stats=\fINUMBER\fR] [\fB\-\-pid=\fIPID\fR] [\fB\-\-retry\fR] [\fB\-\-sleep\-interval=\fISECS\fR] .RB [ \-\-quiet "] [" \-\-silent "] [" \-\-verbose ] .RI [ FILE... ] .BR tail " [" \-\-help "] [" \-\-version ] .SH DESCRIPTION .B tail writes to standard output the last part (10 lines by default) of each .I FILE argument. If .I FILE is omitted or if it is a .RB ` \- ', standard input is used for reading. If more than one \fIFILE\fR is specified, \fBtail\fR prints a one-line header consisting of .sp .nf ==> \fIFILENAME\fR <== .fi .sp before the output for each \fIFILE\fR. \fBtail\fR accepts two option formats: the new one, in which numbers are arguments to the options (`\fB\-n 1\fR'), and the old one, in which the number precedes any option letters (`fB\-1\fR' or `\fB+1\fR'). If any option-argument is a number \fIN\fR starting with a `\fB+\fR', \fBtail\fR begins printing with the \fIN\fRth item from the start of each file, instead of from the end. If the \fIFILE\fR is truncated, \fBtail\fR will detect that it has shrinked, move to the new end of file and start reading from the new end of file. .B tail can output any amount of data (some other non-GNU versions of \fBtail\fR cannot). It also has no \fB\-r\fR option (print in reverse), since reversing a file is really a different job from printing the end of a file; BSD \fBtail\fR (which is the one with \fB\-r\fR) can only reverse files that are at most as large as its buffer, which is typically 32k. A more reliable and versatile way to reverse files is the GNU \fBtac\fR(1) command. .SH OPTIONS .TP .B \fR<\fB-\fR|\fB+\fR>\fICOUNTOPTIONS This option is only recognized if it is specified first. \fICOUNT\fR is a decimal number optionally followed by a size letter .RB (` b "', `" k "', `" m ') as in `\fB\-c\fR', or `\fBl\fR' to mean count by lines, or other option letters (`\fBcfqv\fR'). .TP .B \-c \fIBYTES\fB, \-\-bytes=\fIBYTES Print the last \fIBYTES\fR bytes, instead of final last lines. Appending .RB ` b ' multiplies \fIBYTES\fB by 512, .RB ` k ' by 1024, and .RB ` m ' by 1048576. .TP .B \-f, \-\-follow\fR[\fB=\fIHOW\fR] Loop forever trying to read more characters at the end of the file, presumably because the file is growing. Ignored if reading from a pipe. If more than one file is given, \fBtail\fR prints a header whenever it gets output from a different file, to indicate which file that output is from. You may specify how to track a file: .RS .TP .B descriptor Track the end of the file after it has been unlinked or renamed; that is, forever. .TP .B name Track the end of the file after it has been removed. Once \fBtail\fR finds out that the \fRFILE\fR no longer exists (because it has been unlinked or renamed), it will trying to open it again. .RE .TP .B \-n \fILINES\fB, \-\-lines=\fILINES Output the last \fILINES\fR lines. .TP .B \-q, \-\-quiet, \-\-silent Never print file name headers. .TP .B \-v, \-\-verbose Always print file name headers. .TP .B \-\-max\-consecutive\-size\-changes=\fINUMBER When following by name, follow a file until NUMBER of consecutive size changes have been detected (even if it has been renamed or removed); then check if the filename is still associated with the same device/inode pair as before by opening and fstating the file. Default is 200. .TP .B \-\-max\-unchanged\-stats=\fINUMBER When following by name, after NUMBER of consecutive iterations on which size has remained consant, check if the filename is still associated with the same device/inode pair as before by opening and fstating the file. Default is 5. .TP .B \-\-pid=\fIPID When following a file \fBtail\fR will terminate when process with pid \fIPID\fR does too. If such process doesn't exist, it will terminate after one iteration. .TP .B \-\-retry When \fBtail\fR is following a file by name and detects that it is gone, retry until it succeeds opening it again. Otherwise it will just report the file no longer exists and never check again. .TP .B \-\-sleep\-interval=\fISECS\fR Check tracked files every \fISECS\fR seconds (default is 1) .TP .B "\-\-help" Print a usage message on standard output and exit successfully. .TP .B "\-\-version" Print version information on standard output then exit successfully. .SH NOTES Report bugs to bug-textutils@gnu.org. .br Man page by Ragnar Hojland Espinosa