I have a simple script to print color text in terminal which I've directed to log file too.
#!/bin/bash
echo -e "\033[01;32mGreen color" > ~/Desktop/color.log
When I run from terminal cat color.log, it prints with green color but when I open file with gedit it shows as
[01;32mGreen color
Is it possible to redirect with color in gedit?
Most probably not. There might be an option or a plugin in gedit that allows it to interpret this sort of ANSI color escape code, but that's unlikely since the point of those codes is to display color in terminal-based tools, not a GUI tool like gedit.
I suggest you simply use a terminal based tool to read your files instead. For example, you can use
less -R
which can interpret color codes correctly: