V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
chenqh
V2EX  ›  Linux

tail 有替代品的吗?

  •  
  •   chenqh · 2020-11-06 13:54:23 +08:00 · 3497 次点击
    这是一个创建于 1238 天前的主题,其中的信息可能已经有所发展或是发生改变。

    tail -F 不能 tail 新添加的问题,

    multitail 的宽度有问题

    multitail -d -Q 1 "/home/${USER}/logs/project_*.log" 宽度好像只有 80

    11 条回复    2021-05-01 03:10:42 +08:00
    zouri
        1
    zouri  
       2020-11-06 14:08:03 +08:00
    “不能 tail 新添加” 是啥意思
    heyjei
        2
    heyjei  
       2020-11-06 14:22:30 +08:00 via Android
    不是小写的 f 嘛?
    liuxu
        3
    liuxu  
       2020-11-06 14:23:22 +08:00
    tail -f
    aisk
        4
    aisk  
       2020-11-06 14:23:39 +08:00
    应该是 tail -f 。替代品的话可以尝试 less +F 。
    chenqh
        5
    chenqh  
    OP
       2020-11-06 14:27:30 +08:00 via Android
    噗,可以大写 f 的呀
    larisboy
        6
    larisboy  
       2020-11-06 14:40:03 +08:00
    没记错的话,tail -f 应该是根据文件描述来定位文件,tail -F 应该是根据文件名来定位文件
    KickAssTonight
        7
    KickAssTonight  
       2020-11-06 15:50:23 +08:00
    - Keep reading file until Ctrl + C:
    tail -f file

    - Keep reading file until Ctrl + C, even if the file is rotated:
    tail -F file
    chenqh
        8
    chenqh  
    OP
       2020-11-06 16:12:23 +08:00
    @KickAssTonight 但是 `tail -F ~/proj_*.log` 这个样子, tail 不能 tail 到新加的文件,有 tail 的替代品吗?
    a719114136
        9
    a719114136  
       2020-11-06 16:16:11 +08:00
    没有这个工具,自己写一个吧,也不复杂。
    Reficul
        10
    Reficul  
       2020-11-07 10:17:52 +08:00 via Android
    @chenqh 这个星号是 bash 展开的吧,所以执行的时候文件已经确定了
    wxlg1117
        11
    wxlg1117  
       2021-05-01 03:10:42 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1554 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 17:14 · PVG 01:14 · LAX 10:14 · JFK 13:14
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.