Open System Services Shell and Utilities Reference Manual (G06.27+, H06.04+)
tail(1) OSS Shell and Utilities Reference Manual
NAME
tail - Writes a file from a specified point
SYNOPSIS
Current Syntax
tail
[ -f | -r ]
[ -c [ +|-]number | -n [ +|-]number ]
[ file ]
Obsolescent Syntax
tail
[ +[number][unit]|-[number][unit][f]]
[ -f | -r ]
[ file ]
FLAGS
-c [+|-]number
Writes number bytes of the file. The sign specified before number affects the location
in the file from which to begin writing:
+ (plus) Writing begins relative to the beginning of the file.
- (minus) Writing begins relative to the end of the file.
no sign Writing begins relative to the end of the file.
The value number begins at 1; that is, -c +1 writes the first byte of the file, and -c -1
writes the last byte of the file.
-f Prevents the tail command from terminating after it writes the last line of the input file
if the input file is not read from a pipe (that is, if the input file is a regular file or the file
operand specifies a FIFO). Instead, tail enters an endless loop in which it sleeps for a
second and then attempts to read and write further records from the input file. Thus,
the tail command with the -f flag set can be used to monitor the growth of a file being
written by another process.
The -f flag has no effect if specified with the -r flag.
-n [+|-]number
Writes number lines of the file. The sign specified before number affects the location
in the file from which to begin writing:
+ (plus) Writing begins relative to the beginning of the file.
- (minus) Writing begins relative to the end of the file.
no sign Writing begins relative to the end of the file.
The value number begins at 1; that is, -n +1 writes the first line of the file, and -n -1
writes the last line of the file.
-r Causes tail to write lines from the end of the file in reverse order. This flag overrides
the -f flag.
If the size of the file is not larger than BUFFSIZE, the default action is to write the
entire file; otherwise, -r writes the last BUFFSIZE bytes of the file. (Note that
BUFFSIZE is 10 * LINE_MAX, or 20,480 bytes.)
9−2 Hewlett-Packard Company 527188-004