1TAIL(1) User Commands TAIL(1)
2
3
4
6 tail - output the last part of files
7
9 tail [OPTION]... [FILE]...
10
12 Print the last 10 lines of each FILE to standard output. With more
13 than one FILE, precede each with a header giving the file name.
14
15 With no FILE, or when FILE is -, read standard input.
16
17 Mandatory arguments to long options are mandatory for short options
18 too.
19
20 -c, --bytes=[+]NUM
21 output the last NUM bytes; or use -c +NUM to output starting
22 with byte NUM of each file
23
24 -f, --follow[={name|descriptor}]
25 output appended data as the file grows;
26
27 an absent option argument means 'descriptor'
28
29 -F same as --follow=name --retry
30
31 -n, --lines=[+]NUM
32 output the last NUM lines, instead of the last 10; or use -n
33 +NUM to output starting with line NUM
34
35 --max-unchanged-stats=N
36 with --follow=name, reopen a FILE which has not
37
38 changed size after N (default 5) iterations to see if it has
39 been unlinked or renamed (this is the usual case of rotated log
40 files); with inotify, this option is rarely useful
41
42 --pid=PID
43 with -f, terminate after process ID, PID dies
44
45 -q, --quiet, --silent
46 never output headers giving file names
47
48 --retry
49 keep trying to open a file if it is inaccessible
50
51 -s, --sleep-interval=N
52 with -f, sleep for approximately N seconds (default 1.0) between
53 iterations; with inotify and --pid=P, check process P at least
54 once every N seconds
55
56 -v, --verbose
57 always output headers giving file names
58
59 -z, --zero-terminated
60 line delimiter is NUL, not newline
61
62 --help display this help and exit
63
64 --version
65 output version information and exit
66
67 NUM may have a multiplier suffix: b 512, kB 1000, K 1024, MB 1000*1000,
68 M 1024*1024, GB 1000*1000*1000, G 1024*1024*1024, and so on for T, P,
69 E, Z, Y. Binary prefixes can be used, too: KiB=K, MiB=M, and so on.
70
71 With --follow (-f), tail defaults to following the file descriptor,
72 which means that even if a tail'ed file is renamed, tail will continue
73 to track its end. This default behavior is not desirable when you re‐
74 ally want to track the actual name of the file, not the file descriptor
75 (e.g., log rotation). Use --follow=name in that case. That causes
76 tail to track the named file in a way that accommodates renaming, re‐
77 moval and creation.
78
80 Written by Paul Rubin, David MacKenzie, Ian Lance Taylor, and Jim Mey‐
81 ering.
82
84 GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
85 Report any translation bugs to <https://translationproject.org/team/>
86
88 Copyright © 2022 Free Software Foundation, Inc. License GPLv3+: GNU
89 GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
90 This is free software: you are free to change and redistribute it.
91 There is NO WARRANTY, to the extent permitted by law.
92
94 head(1)
95
96 Full documentation <https://www.gnu.org/software/coreutils/tail>
97 or available locally via: info '(coreutils) tail invocation'
98
99
100
101GNU coreutils 9.1 May 2023 TAIL(1)