tail - output the last part of files
tail [OPTION]... [FILE]...
10
lines of each FILE
to standard output. With morethan one FILE
, precede each with a header giving the file name. With no FILE
, or when FILE
is -
, read standard input.Mandatory arguments to long options are mandatory for short options too.-c, --bytes=[+]NUM
NUM
bytes; or use -c +NUM
to output starting with byte NUM
of each file-f, --follow[={name|descriptor}]
-F
--follow=name
--retry
-n, --lines=[+]NUM
-n +NUM
to output starting with line NUM--max-unchanged-stats=N
--follow=name
, reopen a FILE
which has not changed size after N
(default 5
) iterations to see if it hasbeen unlinked or renamed (this is the usual case of rotated log files); with inotify, this option is rarely usefullinux
--pid=PID
-f
, terminate after process ID
, PID
dies-q, --quiet, --silent
--retry
-s, --sleep-interval=N
-f
, sleep for approximately N
seconds (default 1.0) between iterations; with inotify and --pid=P
, check process P at least once every N
seconds-v, --verbose
-z, --zero-terminated
NUL
, not newline
--help
--version
NUM
may have a multiplier suffix: b 512, kB 1000, K 1024, MB 10001000, M 10241024,GB 100010001000, G 102410241024, and so on for T, P, E, Z, Y.app
- With
--follow
(-f
), 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 thefile descriptor (e.g., log rotation). Use--follow=name
in thatcase.That causes tail to track the named file in a way that accommodates renaming, removal and creation.