tail 中文man页面

系统
在标准输出上显示每个FILE的最后10行. 如果多于一个FILE,会一个接一个地显示, 并在每个文件显示的首部给出文件名. 如果没有FILE,或者FILE是-,那么就从标准输入上读取.

NAME(名称)

tail - 输出文件的末尾部分  

SYNOPSIS(总览)

../src/tail [OPTION]... [FILE]...  

DESCRIPTION(描述)

在标准输出上显示每个FILE的***10行. 如果多于一个FILE,会一个接一个地显示, 并在每个文件显示的首部给出文件名. 如果没有FILE,或者FILE是-,那么就从标准输入上读取.

--retry
即使tail开始时就不能访问或者在tail运行后不能访问,也仍然不停地尝试打开文件. -- 只与-f合用时有用.
-c, --bytes=N
输出***N个字节
-f, --follow[={name|descriptor}]
当文件增长时,输出后续添加的数据; -f, --follow以及 --follow=descriptor 都是相同的意思
-n, --lines=N
输出***N行,而非默认的***10行
--max-unchanged-stats=N
参看texinfo文档(默认为5)
--max-consecutive-size-changes=N
参看texinfo文档(默认为200)
--pid=PID
-f合用,表示在进程ID,PID死掉之后结束.
-q, --quiet, --silent
从不输出给出文件名的首部
-s, --sleep-interval=S
-f合用,表示在每次反复的间隔休眠S秒
-v, --verbose
总是输出给出文件名的首部
--help
显示帮助信息后退出
--version
输出版本信息后退出

如果N(字节或者行数)的***个字符为`+', 那么从每个文件的开头算起的第N项开始显示, 否则, 显示该文件的***N项. N可以有一个倍数前缀: b表示512,k表示1024,m表示1048576(1兆). ***个选项 -VALUE 或+VALUE 以-n VALUE或-n +VALUE 方式看待,除非VALUE含有[bkm]后缀倍数中的一个,在这种情况下,它被看作 -c VALUE 或者-c +VALUE

使用--follow (-f)时,tail默认后接文件描述符, 这意味着即使tail显示的文件改名了,tail仍然可以追踪到其末尾部分. 如果你确实希望查询文件的实际名而非文件描述符 (例如,日志轮转时), 这种默认的操作就不是你所期望的了. 在这种情况下应使用--follow=name. 这将导致tail通过周期性地重新打开所指定的文件来追踪其是否被删除了,或者被其他程序重新创建了.  

AUTHOR(作者)

Paul Rubin, David MacKenzie, Ian Lance Taylor和Jim Meyering.  

REPORTING BUGS(报告BUGS)

请报告bugs到<bug-textutils@gnu.org>.  

COPYRIGHT(版权)

Copyright � 1999 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  

SEE ALSO(另见)

tail 的完整文档是以Texinfo手册形式维护的. 如果 infotail 程序在你那儿都已经安装好了,那么命令

info tail

应该会让你访问到整篇手册.  

#p#

NAME

tail - output the last part of files  

SYNOPSIS

tail [OPTION]... [FILE]...  

DESCRIPTION

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. With no FILE, or when FILE is -, read standard input.

Mandatory arguments to long options are mandatory for short options too.

--retry
keep trying to open a file even if it is inaccessible when tail starts or if it becomes inaccessible later -- useful only with -f
-c, --bytes=N
output the last N bytes
-f, --follow[={name|descriptor}]
output appended data as the file grows; -f, --follow, and --follow=descriptor are equivalent
-F
same as --follow=name --retry
-n, --lines=N
output the last N lines, instead of the last 10
--max-unchanged-stats=N
with --follow=name, 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)
--pid=PID
with -f, terminate after process ID, PID dies
-q, --quiet, --silent
never output headers giving file names
-s, --sleep-interval=S
with -f, sleep for approximately S seconds (default 1.0) between iterations.
-v, --verbose
always output headers giving file names
--help
display this help and exit
--version
output version information and exit

If the first character of N (the number of bytes or lines) is a `+', print beginning with the Nth item from the start of each file, otherwise, print the last N items in the file. N may have a multiplier suffix: b 512, k 1024, m 1024*1024.

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 the file descriptor (e.g., log rotation). Use --follow=name in that case. That causes tail to track the named file by reopening it periodically to see if it has been removed and recreated by some other program.  

AUTHOR

Written by Paul Rubin, David MacKenzie, Ian Lance Taylor, and Jim Meyering.  

REPORTING BUGS

Report bugs to <bug-coreutils@gnu.org>.  

COPYRIGHT

Copyright © 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  

SEE ALSO

The full documentation for tail is maintained as a Texinfo manual. If the info and tail programs are properly installed at your site, the command

info coreutils tail

should give you access to the complete manual.

责任编辑:韩亚珊 来源: CMPP.net
相关推荐

2011-08-24 16:48:36

man中文man

2011-08-15 10:21:09

man中文man

2011-08-11 16:11:49

at中文man

2011-08-25 10:21:56

man.conf中文man

2011-11-01 13:46:50

中文mantac

2011-08-25 16:55:26

gets中文man

2011-08-25 15:49:02

freopen中文man

2011-08-25 16:00:56

fflush中文man

2011-08-25 16:08:55

fsetpos中文man

2011-08-25 15:33:18

exit中文man

2011-08-24 17:19:00

raw中文man

2011-08-25 10:55:37

services中文man

2011-08-25 09:35:26

units中文man

2011-08-24 13:57:35

DECLARE中文man

2011-08-11 15:28:43

ali中文man

2011-08-23 17:18:44

umount中文man

2011-08-23 17:24:11

userdel中文man

2011-08-23 17:33:22

rdev中文man

2011-08-23 18:05:21

ABORT中文man

2011-08-18 19:15:25

group中文man
点赞
收藏

51CTO技术栈公众号