F2Sky
V2EX  ›  问与答

疯长的日志文件可以删除吗?

  •  
  •   F2Sky · Oct 16, 2014 · 2961 views
    This topic created in 4281 days ago, the information mentioned may be changed or developed.
    file:///var/log/ 这个路径下的一个 .log 文件,大小疯长,从一开始的几十 k,到现在好几十 M 了,看样子还会继续疯长下去

    主要是有时候去查看内容,都要滚老半天才能到最新的记录位置,不太方便。

    这种 .log 的日志文件可以随便删除吗?或者有办法让陈旧的记录销掉?

    ps:不是 coder,所以来问大家了。
    3 replies    2014-10-16 15:40:31 +08:00
    sarices
        1
    sarices  
       Oct 16, 2014
    tail /var/log/log文件 -n 行数 可以看最后的n行,反之用head
    rrfeng
        2
    rrfeng  
       Oct 16, 2014
    表示日志经常飙到几十 G ……
    ZOwl
        3
    ZOwl  
       Oct 16, 2014
    logrotate
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4204 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 05:28 · PVG 13:28 · LAX 22:28 · JFK 01:28
    ♥ Do have faith in what you're doing.