grc是一个通用的shell终端加色工具。github地址:https://github.com/garabik/grc。

程序员效率神器:shell命令蜕变,用颜色划出重点

grc是一个用颜色,字体粗细丰富了shell 的输出内容。并且会根据具体shell命令给出直白的提示,比如说红色是告警,df命令100%是磁盘满,提示比较智能,不是无脑的加颜色。

grc支持bash/fish/zsh等等很多shell脚本语言。


安装前:

 

安装后:

 

这样看看我这个地方磁盘挂载分区慢了,用100%红色告警出来。

 


grc使用方法很简单,在原命令之前加个grc。

比如

grc ps aux
grc ping www.baidu.com
grc ls -all

等等。支持以下76个命令的有颜色输出。

ant blkid configure cvs df diff dig dnf -hinels dockerimages

dockerinfo dockernetwork dockerps dockerpull dockersearch dockerversion

du env esperanto fdisk findmnt free gcc getfacl getsebool id ifconfig

tat_sar ip ipaddr ipneighbor iproute iptables irclog iwconfig jobs

last ldap log lolcat ls lsattr lsblk lsmod lsof lspci mount mtr mvn

netstat nmap ntpdate  ping ping2 proftpd ps pv semanageboolean

semanagefcontext semanageuser sensors showmount sql ss stat sysctl

systemctl tcpdump traceroute tune2fs ulimit uptime vmstat wdiff whois


安装方法:

git clone https://github.com/garabik/grc.git
cd grc
bash install.sh

胜象大百科