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. With
14 no FILE, or when FILE is -, read standard input.
15
16 Mandatory arguments to long options are mandatory for short options
17 too.
18
19 --retry
20 keep trying to open a file even if it is inaccessible when tail
21 starts or if it becomes inaccessible later; useful when follow‐
22 ing by name, i.e., with --follow=name
23
24 -c, --bytes=N
25 output the last N bytes; alternatively, use +N to output bytes
26 starting with the Nth of each file
27
28 -f, --follow[={name|descriptor}]
29 output appended data as the file grows; -f, --follow, and --fol‐
30 low=descriptor are equivalent
31
32 -F same as --follow=name --retry
33
34 -n, --lines=N
35 output the last N lines, instead of the last 10; or use +N to
36 output lines starting with the Nth
37
38 --max-unchanged-stats=N
39 with --follow=name, reopen a FILE which has not changed size
40 after N (default 5) iterations to see if it has been unlinked or
41 renamed (this is the usual case of rotated log files)
42
43 --pid=PID
44 with -f, terminate after process ID, PID dies
45
46 -q, --quiet, --silent
47 never output headers giving file names
48
49 -s, --sleep-interval=S
50 with -f, sleep for approximately S seconds (default 1.0) between
51 iterations.
52
53 -v, --verbose
54 always output headers giving file names
55
56 --help display this help and exit
57
58 --version
59 output version information and exit
60
61 If the first character of N (the number of bytes or lines) is a `+',
62 print beginning with the Nth item from the start of each file, other‐
63 wise, print the last N items in the file. N may have a multiplier suf‐
64 fix: b 512, k 1024, m 1024*1024.
65
66 With --follow (-f), tail defaults to following the file descriptor,
67 which means that even if a tail'ed file is renamed, tail will continue
68 to track its end. This default behavior is not desirable when you
69 really want to track the actual name of the file, not the file descrip‐
70 tor (e.g., log rotation). Use --follow=name in that case. That causes
71 tail to track the named file by reopening it periodically to see if it
72 has been removed and recreated by some other program.
73
75 Written by Paul Rubin, David MacKenzie, Ian Lance Taylor, and Jim Mey‐
76 ering.
77
79 Report bugs to <bug-coreutils@gnu.org>.
80
82 Copyright © 2007 Free Software Foundation, Inc.
83 This is free software. You may redistribute copies of it under the
84 terms of the GNU General Public License
85 <http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the
86 extent permitted by law.
87
89 The full documentation for tail is maintained as a Texinfo manual. If
90 the info and tail programs are properly installed at your site, the
91 command
92
93 info tail
94
95 should give you access to the complete manual.
96
97
98
99GNU coreutils 6.9 March 2008 TAIL(1)