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

2022-05-23 12:47:06 +08:00
 hatebugs

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

1707 次点击
所在节点    Linux
4 条回复
julyclyde
2022-05-23 12:56:47 +08:00
polythene
2022-05-23 13:24:47 +08:00
随手 grep --text
hatebugs
2022-05-25 09:01:47 +08:00
@polythene 解决办法有,想知道原因
hatebugs
2022-05-25 09:04:12 +08:00
@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

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/854678

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX