加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

bash – 为ack(-grep)存在什么颜色选项,用于输出,日志等的着色?

发布时间:2020-12-15 18:44:48 所属栏目:安全 来源:网络整理
导读:哪里可以找到可与ack(-grep)一起使用的所有颜色组合的列表?我发现通过ack-grep传递的日志对于检测错误,警告或各种其他条件(尤其是着色)可能是非常有帮助的,但是我还没有找到可以使用组合的权威列表等. tail -f development.log | ack-grep --flush --passt
哪里可以找到可与ack(-grep)一起使用的所有颜色组合的列表?我发现通过ack-grep传递的日志对于检测错误,警告或各种其他条件(尤其是着色)可能是非常有帮助的,但是我还没有找到可以使用组合的权威列表等.
tail -f development.log 
| ack-grep --flush --passthru --color --color-match=yellow "^.*warning.*"

我已经看到了诸如标准颜色的选项:红,蓝,黄,绿等

而且我看到你可以使用“white on_green”

但还有什么?

ack使用Perl的Term :: ANSIColor模块,因此您可以通过以下方式检查可用的内容:
perldoc Term::ANSIColor

以下是相关摘录.

The recognized normal foreground color attributes (colors 0 to 7) are:

     black  red  green  yellow  blue  magenta  cyan  white

   The corresponding bright foreground color attributes (colors 8 to 15)
   are:

     bright_black  bright_red      bright_green  bright_yellow
     bright_blue   bright_magenta  bright_cyan   bright_white

   The recognized normal background color attributes (colors 0 to 7) are:

     on_black  on_red      on_green  on_yellow
     on_blue   on_magenta  on_cyan   on_white

   The recognized bright background color attributes (colors 8 to 15) are:

     on_bright_black  on_bright_red      on_bright_green  on_bright_yellow
     on_bright_blue   on_bright_magenta  on_bright_cyan   on_bright_white

   For any of the above listed attributes,case is not significant.

我也很高兴看到你使用–passthru.

我们欢迎你在ack-users mailing list

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读