仔细想想,这个问题遇到很多次了,之前一直以为很复杂,一搜索发现解决这么简单,记录一下做备忘。

grep test XXX.log
Binary file app.log matches

此时使用-a参数接口。

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

注:zgrep遇到同样问题,解决方法也是类似。

grep命令提示"binary file matches **.log"解决方法的更多相关文章

  1. grep的时候Binary file matches **.log 怎么解决

    操作 grep "hello world" test.log 结果 Binary file test.log matches 原因:grep认为test.log是二进制文件 解决方 ...

  2. vim 编辑提示swap file already exists 解决方法

    linux服务器上编辑 .ini 文件时卡死,关闭连接工具后重新进入操作该 .ini 文件时,会提示: E325: ATTENTION Found a swap file by the name &q ...

  3. 出现命令提示apt-get -f install的解决方法

    提示apt-get -f install这个信息,然后查看其他的提示信息发现时缺少了一些以依赖库. 解决办法为执行:sudo apt-get -f install命令. 该命令的含义是去补全那些缺少的 ...

  4. cygwin中运行命令提示command not found的解决方法

    在cygwin下运行ls等linux常见命令时出现“command not found”的提示,原因是环境变量没有配置好,因此只要将环境变量配置正确,即可正常使用.举例说明,cygwin安装在C盘根目 ...

  5. DedeTag Engine Create File False提示的种种原因及解决方法

    DedeTag Engine Create File False提示的种种原因及解决方法 第一种情况:站点.文件夹权限不足造成无法建立文件 这种情况的出现,一方面可能是Apache设置的读写权限较严格 ...

  6. Centos7解压.tar.bz2提示tar (child): bzip2: Cannot exec: No such file or directory解决方法

    Centos7解压.tar.bz2提示tar (child): bzip2: Cannot exec: No such file or directory解决方法 原因是因为该centos没有bzip ...

  7. Linux系统Vsftp 传文件出现 553 Could Not Create File错误的解决方法

    解决方法: 登录出现了这个错误提示:553 Could not create file SELinux设置如下 查看SELinux设置 [root@localhost ~]# getsebool -a ...

  8. Tex: The top-level auxiliary file: *.aux I couldn't open style file IEEEtran.bst 解决方法

    参考: Bibliography is not printed using Kile on Ubuntu Tex: The top-level auxiliary file: *.aux I coul ...

  9. Linux yum提示Loaded plugins错误的解决方法

    yum是Linux软件包管理器,也叫yum源,在yum使用过程中,有时会出现Loaded plugins错误,重启无效,遇到这种情况该如何解决呢?下面就给大家介绍下Linux yum提示Loaded ...

随机推荐

  1. maven工程指定web资源包,创建jsp文件

    进入项目的project structure. 选择web. 在右侧增加web资源包路径

  2. js闭包理解案例-解决for循环为元素注册事件的问题

      转发自http://www.ruanyifeng.com/blog/2009/08/learning_javascript_closures.html       一.变量的作用域 要理解闭包,首 ...

  3. Python进阶二

    文章目录 函数参数1.位置传递2.名称传递 def f(a,b): f(1,2) f(b=2,a=1) 3.可选参数传递(可选参数必须放在最后)def f(a,b=1) ✔def f(b=1,a) ❌ ...

  4. Assign a Custom Image 设置自定义图标

    In this lesson, you will learn how to associate a business class with a custom image. This image wil ...

  5. 创建线程之三:实现Callable接口

    通过Callable和Future创建线程 i. 创建Callable接口的实现类,并实现call方法,该call方法将作为线程执行体,并且有返回值,可以抛出异常. ii. 创建Callable实现类 ...

  6. UI视图控件、视图嵌套、SubView、Tag 的使用

    - (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchO ...

  7. Error creating bean with name 'sqlSessionFactory' defined in class path resource [config/spring/applicationContext.xml]: Invocation of init method failed;

    我报的错: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSes ...

  8. LINUX中查看、添加、删除PATH以及永久添加PATH

    1.查看PATH变量 echo $PATH 会出现: 路径1:路径2:路径3 2.添加PATH变量 export PATH=$PATH:新添加的路径 用此方法添加的PATH,在关闭或者重启LINUX后 ...

  9. ssm所需依赖

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/20 ...

  10. Codeforces Round #593 (Div. 2)

    传送门 A. Stones 签到. B. Alice and the List of Presents 单独考虑每个数的贡献即可. 答案为\((2^{m}-1)^n\). C. Labs 构造就类似于 ...