hatebugs
V2EX  ›  Linux

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

By hatebugs at 2022 年 5 月 23 日 · 2603 次点击

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

4 条回复  •  2022-05-25 09:04:12 +08:00
polythene
   2
polythene  
   2022 年 5 月 23 日
随手 grep --text
hatebugs
   3
hatebugs  
OP
   2022 年 5 月 25 日 via iPhone
@polythene 解决办法有,想知道原因
hatebugs
   4
hatebugs  
OP
   2022 年 5 月 25 日 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
Distributions
› Ubuntu
› Fedora
› CentOS
中文资源站
› 网易开源镜像站
© 2026 V2EX · 36ms · 3.9.8.5