Go to the first, previous, next, last section, table of contents.


tail: Output the last part of files

tail prints the last part (10 lines by default) of each file; it reads from standard input if no files are given or when given a file of `-'. Synopses:

tail [option]... [file]...
tail -number [option]... [file]...
tail +number [option]... [file]...

If more than one file is specified, tail prints a one-line header consisting of

==> file name <==

before the output for each file.

GNU tail can output any amount of data (some other versions of tail cannot). It also has no `-r' option (print in reverse), since reversing a file is really a different job from printing the end of a file; BSD tail (which is the one with -r) 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 tac command.

tail accepts two option formats: the new one, in which numbers are arguments to the options (`-n 1'), and the old one, in which the number precedes any option letters (`-1' or `+1').

If any option-argument is a number n starting with a `+', tail begins printing with the nth item from the start of each file, instead of from the end.

The program accepts the following options. Also see section Common options.

`-count'
`+count'
This option is only recognized if it is specified first. count is a decimal number optionally followed by a size letter (`b', `k', `m') as in -c, or `l' to mean count by lines, or other option letters (`cfqv').
`-c bytes'
`--bytes=bytes'
Output the last bytes bytes, instead of final lines. Appending `b' multiplies bytes by 512, `k' by 1024, and `m' by 1048576.
`-f'
`--follow'
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, tail prints a header whenever it gets output from a different file, to indicate which file that output is from.
`-n n'
`--lines=n'
Output the last n lines.
`-q'
`-quiet'
`--silent'
Never print file name headers.
`-v'
`--verbose'
Always print file name headers.


Go to the first, previous, next, last section, table of contents.