The characters ^[[37m and ^[[0m are part of the ANSI escape sequences (CSI codes). See also these specifications. Using GNU sed sed -e 's/\x1b\[[0-9;]*m//g' \x1b (or \x1B) is the escape special character (GNU sed does not support alternatives \e and \033) \[ is the second character of the escape sequence [0-9;]* is the color value(s) regex m is the last character of the escape sequence Using the m
