aboutsummaryrefslogtreecommitdiff
path: root/man/tail.1
blob: 02d3e32ba83b026020f5b9e97abcb68f38fc3e9f (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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
.\" Adapted for BNU from the GNU Coreutils 9.11 manual page; see doc/README.md.
.TH TAIL "1" "2026-07-28" "BNU 9.11" "BNU Commands"
.SH NAME
tail \- output the last part of files
.SH SYNOPSIS
.B tail
[\fI\,OPTION\/\fR]... [\fI\,FILE\/\fR]...
.SH DESCRIPTION
.\" This page is derived from GNU Coreutils documentation.
This page documents BNU, an independent Bun implementation compatible with
GNU Coreutils 9.11.
.PP
Print the last 10 lines of each FILE to standard output.
With more than one FILE, precede each with a header giving the file name.
.PP
With no FILE, or when FILE is \-, read standard input.
.PP
Mandatory arguments to long options are mandatory for short options too.
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#tail-c'\fB\-c, \-\-bytes=\,[+]NUM\fP\X'tty: link'\/\fR
output the last NUM bytes;
or use \fB\-c\fR +NUM to output starting with byte NUM of each file
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#tail--debug'\fB\-\-debug\fP\X'tty: link'
indicate which \fB\-\-follow\fR implementation is used
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#tail-f'\fB\-f, \-\-follow[=\,{name|descriptor}]\fP\X'tty: link'\/\fR
output appended data as the file grows;
an absent option argument means 'descriptor'
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#tail-F'\fB\-F\fP\X'tty: link'
same as \fB\-\-follow\fR=\fI\,name\/\fR \fB\-\-retry\fR
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#tail-n'\fB\-n, \-\-lines=\,[+]NUM\fP\X'tty: link'\/\fR
output the last NUM lines, instead of the last 10;
or use \fB\-n\fR +NUM to skip NUM\-1 lines at the start
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#tail--max-unchanged-stats'\fB\-\-max\-unchanged\-stats=N\fP\X'tty: link'
with \fB\-\-follow\fR=\fI\,name\/\fR, reopen a FILE which has not
changed size after N (default 5) iterations
to see if it has been unlinked or renamed
(this is the usual case of rotated log files);
with inotify, this option is rarely useful
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#tail--pid'\fB\-\-pid=PID\fP\X'tty: link'
with \fB\-f\fR, exit after PID no longer exists;
can be repeated to watch multiple processes
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#tail-q'\fB\-q, \-\-quiet, \-\-silent\fP\X'tty: link'
never output headers giving file names
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#tail--retry'\fB\-\-retry\fP\X'tty: link'
keep trying to open a file if it is inaccessible
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#tail-s'\fB\-s, \-\-sleep\-interval=\,N\fP\X'tty: link'\/\fR
with \fB\-f\fR, sleep for approximately N seconds
(default 1.0) between iterations;
with inotify and \fB\-\-pid\fR=\fI\,P\/\fR,
check process P at least once every N seconds
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#tail-v'\fB\-v, \-\-verbose\fP\X'tty: link'
always output headers giving file names
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#tail-z'\fB\-z, \-\-zero\-terminated\fP\X'tty: link'
line delimiter is NUL, not newline
.TP
\X'tty: link https://www.gnu.org/software/coreutils/tail#tail--help'\fB\-\-help\fP\X'tty: link'
display this help and exit
.TP
\X'tty: link https://www.gnu.org/software/coreutils/tail#tail--version'\fB\-\-version\fP\X'tty: link'
output version information and exit
.PP
NUM may have a multiplier suffix:
b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024,
GB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y, R, Q.
Binary prefixes can be used, too: KiB=K, MiB=M, and so on.
.PP
With \fB\-\-follow\fR (\fB\-f\fR), tail defaults to following the file descriptor, which
means that even if a tail'ed file is renamed, tail will continue to track
its end.  This default behavior is not desirable when you really want to
track the actual name of the file, not the file descriptor (e.g., log
rotation).  Use \fB\-\-follow\fR=\fI\,name\/\fR in that case.  That causes tail to track the
named file in a way that accommodates renaming, removal and creation.
.SH AUTHORS
Upstream GNU Coreutils documentation authors:
Written by Paul Rubin, David MacKenzie, Ian Lance Taylor,
and Jim Meyering.
.br
Adapted for BNU; the BNU implementation is independent.
.SH "REPORTING BUGS"
Report BNU bugs at <https://github.com/Soccera1/bnu/issues>.
.br
For upstream GNU Coreutils, see <https://www.gnu.org/software/coreutils/>.
.SH COPYRIGHT
Copyright \(co 2026 Free Software Foundation, Inc.
.br
This manual page was adapted for BNU in 2026.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
.br
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
.SH "SEE ALSO"
\fBhead\fP(1)
.PP
.br
Upstream documentation <https://www.gnu.org/software/coreutils/tail>
.br
BNU documentation is available locally via: info \(aq(bnu) tail invocation\(aq