grep output with multiple colors
https://stackoverflow.com/questions/17236005/grep-output-with-multiple-colors
ANSI escape 코드
https://packagecontrol.io/packages/ANSIescape
실시간 출력되는 log에서 내가 원하는 부분에 색을 적용해 가독성을 높이고 싶어서 찾아봤다.
파이프 라인을 이용해 다음과 같은 egrep 명령어를 사용하면 된다.
// $를 안 쓰면 something만 찾게 돼서 전체가 출력되지 않는다.
GREP_COLOR='01;36' egrep --color=always 'something|$'
사용 예시
tail -f mylog | GREP_COLOR='01;36' egrep --color=always 'ssh|$' | GREP_COLOR='01;31' egrep -i --color=always 'drop|deny|$'