zoukankan      html  css  js  c++  java
  • tailf 跟踪日志文件

    1.命令功能

    tailf 跟踪日志文件增长,作用跟tail –f相同。tailf将输出文件的最后10行,然后等待文件增长。

    2.语法格式

    tailf  option  file

    参数说明

    参数

    参数说明

    -n

    指定显示文件最后的行数(默认显示最后10行)

    3.使用范例

    范例1 tailf 跟踪日志

    [root@localhost chu]# tailf /var/log/messages
    
    Apr 24 04:04:44 localhost sshd[1410]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
    
    Apr 24 04:04:44 localhost sshd[1410]: error: Bind to port 22 on :: failed: Address already in use.
    
    Apr 24 04:04:44 localhost sshd[1410]: fatal: Cannot bind any address.
    
    Apr 24 04:20:55 localhost sshd[1429]: Accepted password for root from 172.16.2.100 port 3895 ssh2
    
    Apr 24 04:21:04 localhost sftp-server[1444]: error: Unknown extended request "fs-multiple-roots-supported@vandyke.com"
    
    Apr 24 04:21:04 localhost sftp-server[1444]: error: Unknown extended request "openex@vandyke.com"
    
    Apr 24 04:21:04 localhost sftp-server[1444]: error: Unknown extended request "vendor-id"
    
    Apr 24 04:22:44 localhost sshd[1467]: Accepted password for root from 172.16.2.100 port 4045 ssh2
    
    Apr 24 04:22:47 localhost sshd[1482]: Accepted password for root from 172.16.2.100 port 4048 ssh2
    
    Apr 24 04:23:03 localhost sshd[1498]: Accepted password for root from 172.16.2.100 port 4063 ssh2

    范例2 显示最后4行

    [root@localhost chu]# tailf -4 /var/log/messages
    
    Apr 24 04:21:04 localhost sftp-server[1444]: error: Unknown extended request "vendor-id"
    
    Apr 24 04:22:44 localhost sshd[1467]: Accepted password for root from 172.16.2.100 port 4045 ssh2
    
    Apr 24 04:22:47 localhost sshd[1482]: Accepted password for root from 172.16.2.100 port 4048 ssh2
    
    Apr 24 04:23:03 localhost sshd[1498]: Accepted password for root from 172.16.2.100 port 4063 ssh2
  • 相关阅读:
    swift init继承问题
    CocoaPods 使用本地代码
    关于Xcode6 Segue 的疑问,没有解决!
    Cocos2d 学习资料推荐
    iOS8中 UILocalNotification 和 UIRemoteNotification 使用注意
    Cocos2d 初学基本知识
    iOS 和 Android 触摸事件传递
    iOS NSOperation的使用
    Android 相机对焦模式
    AES 推荐文章
  • 原文地址:https://www.cnblogs.com/joechu/p/8947465.html
Copyright © 2011-2022 走看看