tail.1 (2010 09)
t
tail(1) tail(1)
NAME
tail - deliver the last part of a file
SYNOPSIS
tail [-f][-b number ][file ]
tail [-f][-c number ][file ]
tail [-f][-n number ][file ]
Obsolescent:
tail [±[ number ]][
lbc][-f][file ]
DESCRIPTION
tail copies the named file to the standard output beginning at a designated place. If no file is named,
standard input is used.
Command Forms
tail can be used in three forms as indicated above:
tail -b number... Copy file starting at number blocks from end or beginning of file.
tail -c number... Copy file starting at number bytes from end or beginning of file.
tail -n number...
tail number... Copy file starting at number lines from end or beginning of file.
tail with no options specified is equivalent to tail -n 10 ... .
Options and Command-Line Arguments
tail recognizes the following options and command-line arguments:
-f Follow option. If the input file is a regular file or if file specifies a
FIFO, do not ter-
minate after the last line of the input file has been copied, but read and copy
further bytes from the input file when they become available (
tail enters an end-
less loop wherein it sleeps for one second then attempts to read and copy further
records from the input file). This is useful when monitoring text being written to a
file by another process. If no file argument is specified and the input is a pipe
(FIFO), the -f option is ignored.
number Decimal integer indicating quantity of output to be copied, measured in units
specified by accompanying option. If number is preceded by a
+ character, copy
operation starts number units from beginning of file. If number is preceded by a -
character or the option name, copy operation starts number units from end of file.
If number is not preceded by a b, c,or n option, -n is assumed. If both the option
and number are not specified, -n 10 is assumed.
-b number Copy file beginning number 512-byte blocks from end or beginning of file. If
number is not specified, -b 10 is assumed. See number description above.
-c number Copy file beginning number bytes from end or beginning of file. If number is not
specified, -c 10 is assumed. See number description above.
-n number Copy file beginning number lines from end or beginning of file. If number is not
specified, -n 10 is assumed. See number description above.
file Name of file to be copied. If not specified, the standard input is used.
If the
-c option is specified, the input file can contain arbitrary data. Otherwise, the input file should be
a text file.
Obsolescent Form
In the obsolescent form, option letters can be concatenated after the number argument to select blocks,
bytes, or lines. If this syntax is used,
±number must be the first argument given. If number is not
specified, −10 is assumed. This version is provided for backward compatibility only. The forms discussed
previously are recommended for portability.
HP-UX 11i Version 3: September 2010 − 1 − Hewlett-Packard Company 1