Skip to content

Instantly share code, notes, and snippets.

@mygoare
Last active January 3, 2016 02:29
Show Gist options
  • Save mygoare/8395524 to your computer and use it in GitHub Desktop.
Save mygoare/8395524 to your computer and use it in GitHub Desktop.
color bash

##用于在shell中给输出上色 ( Colored Bash )

###基本结构:

\033[A;B;Cm YOUR CONTENT \033[m

###A B C是字母替代

A => Attribute codes

00=none, 01=bold, 04=underscore, 05=blink, 07=reverse, 08=concealed


B => Text color codes

30=black, 31=red, 32=green, 33=yellow, 34=blue, 35=magenta, 36=cyan, 37=white


C => Background color codes

40=black, 41=red, 42=green, 43=yellow, 44=blue, 45=magenta, 46=cyan, 47=white

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment