TAIL(1) — USER COMMANDS
NAME
tail − display the last part of a file
SYNOPSIS
tail +|−number[lbc][fr] [ filename ]
DESCRIPTION
tail copies filename to the standard output beginning at a designated place. If no file is named, the standard input is used.
OPTIONS
Options are all jammed together, not specified separately with their own − signs.
+number
Begin copying at distance number from the beginning of the file. number is counted in units of lines, blocks or characters, according to the appended option l, b, or c. When no units are specified, counting is by lines. If number is not specified, the value 10 is used.
−number
Begin copying at distance number from the end of the file. Number is counted in units of lines, blocks or characters, according to the appended option l, b, or c. When no units are specified, counting is by lines. If number is not specified, the value 10 is used.
r Copy lines from the end of the file in reverse order. The default for r is to print the entire file this way.
f If the input file is not a pipe, do not terminate after the line of the input file has been copied, but enter an endless loop, sleeping for a second and then attempting to read and copy further records from the input file. This option may be used to monitor the growth of a file that is being written by some other process. For example, the command:
tail −f fred
will print the last ten lines of the file fred, followed by any lines that are appended to fred between the time tail is initiated and killed. As another example, the command:
tail −15cf fred
will print the last 15 characters of the file fred, followed by any lines that are appended to fred between the time tail is initiated and killed.
SEE ALSO
BUGS
Data for a tail relative to the end of the file is stored in a buffer, and thus is limited in size.
Various kinds of anomalous behavior may happen with character special files.
Sun Release 3.2 — Last change: 17 February 1986