优秀的编程知识分享平台

网站首页 > 技术文章 正文

Linux中grep 文件提示Binary file /var/log/messages matches

nanyue 2024-09-10 16:12:06 技术文章 4 ℃

我们Linux系统上经常通过grep命令检索关键字,有时候会提示Binary file matches的信息,我们在这里可以通过-a 参数。

grep test /var/log/messages
Binary file /var/log/messages matches

#man grep

File and Directory Selection

-a, --text

Process a binary file as if it were text; this is equivalent to the --binary-files=text option.


grep -a test /var/log/messages
  • -a, --text equivalent to --binary-files=text,即让二进制文件等价于文本。

Tags:

最近发表
标签列表