Documentation
¶
Overview ¶
Package tail implements the tail utility.
It copies the last part of each given file to the standard output, starting at the point given by the -n or -c options, defaulting to the last 10 lines. When more than one operand is given, a "==> name <==" header precedes the output of each file; -q and -v make the headers never or always printed. The standard input is used when no operand is given, and also when the operand is "-". With -f, or --follow=name with --retry, as with -F, the inputs keep being copied as further data becomes available: by descriptor, which keeps reading the open files, or by name, which also reopens them when replaced or removed, reporting truncations and printing a header whenever the output comes from a different file. The --pid, -s and --max-unchanged-stats options tune the waiting: tail exits once all the given processes no longer exist, waits a given number of seconds between iterations, and rechecks a name after a given number of unchanged ones. The obsolete first-operand forms tail -NUM and tail +NUM, with an optional b, c or l size letter and a trailing f, are accepted too.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Prog ¶
Prog is the tail core utility.
func (*Prog) Run ¶
Run writes the designated part of the given files to the standard output, in the same order the operands are given. The standard input is used when no operands are given, and also when an operand is "-". With -f, the inputs keep being copied as further data becomes available, and Run only returns once ctx is done, all the writers given with --pid no longer exist, or every followed name is given up. A failing file doesn't stop the others.
Reading is interrupted when ctx is done, and the context error is returned.