With GREP_COLOR enabled, grep --color=auto colors the entire line when the pattern is "." or "^.".
It's not a big problem, and maybe my understanding is wrong, but I would expect the . to match only the first character, and hence only the first character should be colored. (Colored or highlighted part indicated by underscores) $ export GREP_COLOR=4 $ grep --version grep (GNU grep) 2.5.1 Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ echo "foo" | grep --color=auto "f" _f_oo $ echo "foo" | grep --color=auto "." _foo_ $ echo "foo" | grep --color=auto "^." _foo_ With 2.5.3, it's half fixed. $ src/grep --version GNU grep 2.5.3 Copyright (C) 1988, 1992-2002, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ echo "foo" | src/grep --color=auto "f" _f_oo $ echo "foo" | src/grep --color=auto "." _foo_ $ echo "foo" | src/grep --color=auto "^." _f_oo
