“grep:line too long”错误信息 [英] "grep: line too long" error message

查看:465
本文介绍了“grep:line too long”错误信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了在 / etc



下找到IP地址,我使用了以下语法(Dennis Williamson在超级用户的网站)

但我收到消息grep:line too long。



有人有想法

  grep -Er'\<([0-9] { ){3} [0-9] {1,3} \>'/ etc / 
grep:行太长


解决方案

find / xargs解决方案对我无效,但导致相同的错误。



我使用 -I grep选项(忽略二进制文件)解决了这个问题。在我的情况下,文件列表中必须有一个二进制文件才能搜索到没有换行符,所以grep试图读取一个太大的巨大行。这是我对这个错误意味着什么的猜测。



我的想法来自: http://web.archiveorange.com/archive/v/am8x7wI0r0243prrmYd4



当然,这可能对您不适用有一行文本文件太长。


I used the following syntax in order to find IP address under /etc

(answered by Dennis Williamson in superuser site)

but I get the message "grep: line too long".

Someone have idea how to ignore this message and why I get this?

  grep -Er '\<([0-9]{1,3}\.){3}[0-9]{1,3}\>' /etc/
  grep: line too long

解决方案

The find/xargs solution didn't work for me, but resulted in the same error.

I solved this problem by using the -I grep option (ignore binary files). In my case there must have been a binary file in the list of files to search that had no linebreaks, so grep tries to read in a gigantic line that is too big. That's my guess at what this error means.

I got the idea from: http://web.archiveorange.com/archive/v/am8x7wI0r0243prrmYd4

This might not work for you of course if there's a text file with a line that is too long.

这篇关于“grep:line too long”错误信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆