如何截断由grep或ack返回的长匹配线

我想运行ack或grep的html文件,通常有很长的行。我不想看到非常长的行包装重复。但我确实希望看到围绕与正则表达式匹配的字符串的长线的那部分。我如何得到这个使用unix工具的任何组合?
您可以使用grep选项-o,可能结合将模式更改为“。{0,10}< original pattern>。{0,10}”,以便查看其周围的一些上下文:
       -o,--only-matching
              Show only the part of a matching line that matches PATTERN.

..or -c:

       -c,--count
              Suppress normal output; instead print a count of matching  lines
              for  each  input  file.  With the -v,--invert-match option (see
              below),count non-matching lines.

相关文章

用的openwrt路由器,家里宽带申请了动态公网ip,为了方便把2...
#!/bin/bashcommand1&command2&wait从Shell脚本并行...
1.先查出MAMP下面集成的PHP版本cd/Applications/MAMP/bin/ph...
1、先输入locale-a,查看一下现在已安装的语言2、若不存在如...
BashPerlTclsyntaxdiff1.进制数表示Languagebinaryoctalhexa...
正常安装了k8s后,使用kubect工具后接的命令不能直接tab补全...