aboutsummaryrefslogtreecommitdiff
path: root/man/man1/tail.1
blob: 7b218cef1410354b9e61312308c4de26d9df6b73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
.TH TAIL 1
.SH NAME
tail \- deliver the last part of a file
.SH SYNOPSIS
.B tail
[
.BR +- \fInumber\fP[ lbc ][ rf ]
]
[
.I file
]
.PP
.B tail
[
.B -fr
]
[
.B -n
.I nlines
]
[
.B -c
.I nbytes
]
[
.I file
]
.SH DESCRIPTION
.I Tail
copies the named file to the standard output beginning
at a designated place.
If no file is named, the standard input is copied.
.PP
Copying begins at position
.BI + number
measured from the beginning, or
.BI - number
from the end of the input.
.I Number
is counted in lines, 1K blocks or bytes,
according to the appended flag
.LR l ,
.LR b ,
or
.LR c .
Default is
.B -10l
(ten ell).
.PP
The further flag
.L r
causes tail to print lines from the end of the file in reverse order;
.L f
(follow) causes
.IR tail ,
after printing to the end, to keep watch and
print further data as it appears.
.PP
The second syntax is that promulgated by POSIX, where
the
.I numbers
rather than the options are signed.
.SH EXAMPLES
.TP
.B tail file
Print the last 10 lines of a file.
.TP
.B tail +0f file
Print a file, and continue to watch
data accumulate as it grows.
.TP
.B sed 10q file
Print the first 10 lines of a file.
.SH SOURCE
.B \*9/src/cmd/tail.c
.SH BUGS
Tails relative to the end of the file
are treasured up in a buffer, and thus
are limited in length.
.PP
According to custom, option
.BI + number
counts lines from 1, and counts
blocks and bytes from 0.
.PP
.I Tail
is ignorant of UTF.