IT开放社区

tail命令详解--文件内容查看(一)

tail命令用于显示文件尾部内容,tail命令默认显示指定文件尾部10行。

 语法 

tail [选项] [参数]
 选项 

-(n):指定显示文件结尾 n 行;

-f (fdescriptor)或--follow:显示文件最新追加的内容(最常用的选项,常用于监控日志文件)。

 参数 

指定要显示的文件
 实例 

tail默认用法:

[root@ogg ~]# tail anaconda-ks.cfg 
kexec-tools
iscsi-initiator-utils
fipscheck
squashfs-tools
device-mapper-multipath
sgpio
emacs
libsane-hpaio
xorg-x11-utils
xorg-x11-server-Xnest
[root@ogg ~]#  tail -2 1

123456789

-f选项的用法:

[root@ogg ~]# tail -f anaconda-ks.cfg 
kexec-tools
iscsi-initiator-utils
fipscheck
squashfs-tools
device-mapper-multipath
sgpio
emacs
libsane-hpaio
xorg-x11-utils
xorg-x11-server-Xnest

[root@ogg ~]# tail -15f anaconda-ks.cfg 
@printing
@sound-and-video
@text-internet
@base-x
system-config-kickstart
kexec-tools
iscsi-initiator-utils
fipscheck
squashfs-tools
device-mapper-multipath
sgpio
emacs
libsane-hpaio
xorg-x11-utils
xorg-x11-server-Xnest


发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

网站分类
站点信息
  • 文章总数:119
  • 页面总数:2
  • 分类总数:3
  • 标签总数:12
  • 评论总数:2
  • 浏览总数:116129
友情链接

BlogPowerBy Z-BlogPHP 1.5 Zero ;Theme By 爱墙纸

Copyright © 2020-2030 ITkaifang.COM All Rights Reserved. 京ICP备13044647号.Email:dreamerqin@qq.com