V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
hatebugs
V2EX  ›  Linux

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

  •  
  •   hatebugs · May 23, 2022 · 2260 views
    This topic created in 1443 days ago, the information mentioned may be changed or developed.

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

    4 replies    2022-05-25 09:04:12 +08:00
    polythene
        2
    polythene  
       May 23, 2022
    随手 grep --text
    hatebugs
        3
    hatebugs  
    OP
       May 25, 2022 via iPhone
    @polythene 解决办法有,想知道原因
    hatebugs
        4
    hatebugs  
    OP
       May 25, 2022 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
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   769 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 20:34 · PVG 04:34 · LAX 13:34 · JFK 16:34
    ♥ Do have faith in what you're doing.