【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 文件里的最尾部的内容显示在屏幕上,并且不断刷新,只 ...
随机推荐
- bzoj 3120 矩阵优化DP
我的第一道需要程序建矩阵的矩阵优化DP. 题目可以将不同的p分开处理. 对于p==0 || p==1 直接是0或1 对于p>1,就要DP了.这里以p==3为例: 设dp[i][s1][s2][r ...
- C#利用NPOI在同一个Excel文件中创建多个sheet
借用NPOI来实现,要在同一Excel文件中创建多个sheet,只需要在同一个workbook中创建多个sheet即可.要注意的是,sheet的名字一定不能重复.下面是实现的代码: private v ...
- ASM相关视图
oracle asm对于我们并非一个黑盒子 ,我们能够通过对应视图查看asm instance信息,和oracle系统视图一样. v$asm_diskgroup x$kfgrp 记录diskgrou ...
- Wide-range regulator delivers 12V, 3A output from 16 to 100V source
Synchronous buck regulators offer high efficiency and are popular in applications in which available ...
- Simple microcontroller-temperature measurement uses only a diode and a capacitor
Using a PN-junction diode for temperature measurement usually depends on its 2‑mV/K temperature coe ...
- Buck converter uses low-side PWM IC
The most common switching-power topology is a buck converter, which efficiently transforms high volt ...
- gitignore / Delphi.gitignore
https://github.com/github/gitignore/blob/master/Delphi.gitignore *.dcu *.~*~ *.local *.identcache __ ...
- 计蒜之道 初赛 第三场 题解 Manacher o(n)求最长公共回文串 线段树
腾讯手机地图 腾讯手机地图的定位功能用到了用户手机的多种信号,这当中有的信号的作用范围近.有的信号作用的范围则远一些.有的信号相对于用户在不同的方位强度是不同的,有的则是在不论什么一个方向上信号强度都 ...
- 搞定android多点触摸模拟
原理在android 创建多点触摸虚拟设备,然后往设备写模拟数据可以
- Android 下文件cannot execute - Permission denied
安卓下执行交叉编译的可执行文件发现提示不允许. 原因是mount的方式问题,root后运行 su mount -o rw,remount /mnt/sdcard 就可以了 mount -o rw,re ...