【Linux】tail命令
用途
tail命令主要用于取出后边几行
全称
tail命令的全称即为tail(尾巴)
参数
-n :后边接数字,代表显示几行的意思
-f :循环读取
-q :不显示处理信息
-v :显示详细的处理信息
案例
案例一:显示文件最后5行内容
[root@bigdata ~]# tail -5 /etc/man_db.conf
#
#---------------------------------------------------------
# Flags.
# NOCACHE keeps man from creating cat pages.
#NOCACHE
案例二:循环查看文件内容
[root@bigdata /]# ping localhost >test.txt &
[4] 9944
[root@bigdata /]# tail -f test.txt
64 bytes from localhost (127.0.0.1): icmp_seq=1791 ttl=64 time=0.112 ms
64 bytes from localhost (127.0.0.1): icmp_seq=1792 ttl=64 time=0.161 ms
bytes from localhost (127.0.0.1): icmp_seq=1793 ttl=64 time=0.166 ms
64 bytes from localhost (127.0.0.1): icmp_seq=1794 ttl=64 time=0.133 ms
….
想要结束按CTRL+C即可
案例三:从第5行开始显示文件
[root@bigdata /]# tail -n +5 /etc/man_db.conf
# their PATH environment variable. For details see the manpath(5) man page.
#
# Lines beginning with `#' are comments and are ignored. Any combination of
# tabs or spaces may be used as `whitespace' separators.
#
# There are three mappings allowed in this file:
# --------------------------------------------------------
# MANDATORY_MANPATH manpath_element
# MANPATH_MAP path_element manpath_element
# MANDB_MAP global_manpath [relative_catpath]
#---------------------------------------------------------
……
【Linux】tail命令的更多相关文章
- 【转载】linux tail命令的使用方法详解
本文介绍Linux下tail命令的使用方法.linux tail命令用途是依照要求将指定的文件的最后部分输出到标准设备,通常是终端,通俗讲来,就是把某个档案文件的最后几行显示到终端上,假设该档案有更新 ...
- linux tail命令的使用方法详解(转)
本文介绍Linux下tail命令的使用方法.linux tail命令用途是依照要求将指定的文件的最后部分输出到标准设备,通常是终端,通俗讲来,就是把某个档案文件的最后几行显示到终端上,假设该档案有更新 ...
- linux tail命令的使用方法详解 (转载)
本文介绍Linux下tail命令的使用方法.linux tail命令用途是依照要求将指定的文件的最后部分输出到标准设备,通常是终端,通俗讲来,就是把某个档案文件的最后几行显示到终端上,假设该档案有更新 ...
- linux tail 命令详解
linux ---tail命令 linux中tail命令---用于查看文件内容 最基本的是cat.more和less. 1. 如果你只想看文件的前5行,可以使用head命令,如: head -5 /e ...
- 【转】Linux tail 命令详解
Linux tail 命令详解 http://www.2cto.com/os/201111/110143.html
- linux tail命令的使用方法详解
本文介绍Linux下tail命令的使用方法. linux tail命令用途是依照要求将指定的文件的最后部分输出到标准设备,通常是终端,通俗讲来,就是把某个档案文件的最后几行显示到终端上,假设该档案有更 ...
- 【转】linux tail命令使用方法详解
原文网址:http://www.111cn.net/sys/linux/46902.htm linux tail命令用途是按照要求将指定的文件的最后部分输出到标准设备,一般是终端,通俗讲来,就是把某个 ...
- linux tail命令及其它日志查看命令的用法
当日志文件存储日志很大时,我们就不能用vi直接进去查看日志,需要Linux的命令去完成我们的查看任务. Log位置: /var/log/message 系统启动后的信息和错误日志,是Red Hat L ...
- linux tail 命令详解!Linux 文件内容查看工具介绍
转:http://blog.csdn.net/carzyer/article/details/4759593 1.cat 显示文件连接文件内容的工具: cat 是一个文本文件查看和连接工具.查看一个文 ...
- Linux tail 命令
tail 命令可用于查看文件的内容,有一个常用的参数 -f 常用于查阅正在改变的日志文件. tail -f filename 会把 filename 文件里的最尾部的内容显示在屏幕上,并且不断刷新,只 ...
随机推荐
- tarjan算法+缩点--cojs 908. 校园网
cojs 908. 校园网 ★★ 输入文件:schlnet.in 输出文件:schlnet.out 简单对比时间限制:1 s 内存限制:128 MB USACO/schlnet(译 b ...
- 树莓派(Debian)系统开启iptables的raw表实现日志输出
说明:可能Debian默认不开启iptables的raw表,所以无法通过其实现日志跟踪. 日志跟踪:http://www.cnblogs.com/EasonJim/p/8413563.html 解决方 ...
- HTML5开发的翻页效果实例
简介2010年F-i.com和Google Chrome团队合力致力于主题为<20 Things I Learned about Browsers and the Web>(www.20t ...
- HDU 4498 Function Curve (分段,算曲线积分)
Function Curve Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)To ...
- Visual Studio 2010 使用 Git Extensions 连接 google code
下载最新版本 Git Extensions http://code.google.com/p/gitextensions/downloads/list Git Extensions 2.46 Wind ...
- /dev/fb0入门练习
转:http://hi.baidu.com/fsx92/item/bdbf90d8adab409f260ae738 大家都知道Unix/Linux系统是由命令驱动的.那么最基本的系统是命令行的(就是想 ...
- wget 下载文件重进行命名
wget在下载的时候就重命名的: wget -c "www.baidu.com" -O baidu.index.html 保存输出日至,可以使用: wget -c "ww ...
- OpenCV图像平滑处理
图像平滑处理 目标 本教程教您怎样使用各种线性滤波器对图像进行平滑处理,相关OpenCV函数如下: blur GaussianBlur medianBlur bilateralFilter 原理 No ...
- linux开机启动的三种方式
参考:www.cnblogs.com/gzggyy/archive/2012/08/07/2626574.html 一./etc/rc.local 其中的rc.local是在完成所有的系统初始化之后执 ...
- POJ 1737 Connected Graph 题解(未完成)
Connected Graph Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 3156 Accepted: 1533 D ...