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

不知道为什么 log 文件突然变成了二进制格式?

  •  
  •   hatebugs · 2022-05-23 12:47:06 +08:00 · 1682 次点击
    这是一个创建于 675 天前的主题,其中的信息可能已经有所发展或是发生改变。

    你知道你们是否遇到过,文件里有些^@^@^@符号,linux 把文件识别成二进制了,导致 grep 全部失效

    4 条回复    2022-05-25 09:04:12 +08:00
    polythene
        2
    polythene  
       2022-05-23 13:24:47 +08:00
    随手 grep --text
    hatebugs
        3
    hatebugs  
    OP
       2022-05-25 09:01:47 +08:00 via iPhone
    @polythene 解决办法有,想知道原因
    hatebugs
        4
    hatebugs  
    OP
       2022-05-25 09:04:12 +08:00 via iPhone   ❤️ 1
    @julyclyde Other common causes of NULs in a text file are: 1. a process truncated the file while another process was writing it, so the second process's writes suddenly went past the current EOF, so the gap became sparsely allocated all-zero space. 2. The file was modified shortly before a system crash and the filesystem recovered the file's size without recovering all the data
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3213 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 13:06 · PVG 21:06 · LAX 06:06 · JFK 09:06
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.