Using the echo "-e" flag causes color codes to be interpreted: echo -e "\e[0;31mThis is red\e[0m" echo "\e[0;31mThis is not red\e[0m" Is there a way to do this with sed? | sed -E "s/(something_to_highlight)/\e[0;31m\1\e[0m/g" Richard