2011-02-22 Grep by Color Computer Prints all lines of a file. If a line matches a regular expression, the line is colored. $ perl -nle 'print ((m/char/ ? "\e[31m" : "\e[0m") . "$_")' hoge.c