I want to store the result of grep in a file with the formatting in the same way as the output in Konsole(Kubuntu). I tried to save it in a LibreOffice doc but the result is no different then the result in text file. How do i do store the result in the file with the formatting? I mean how do i store the result with the colored output?
migrated from stackoverflow.com Oct 27 '12 at 8:45
This question came from our site for professional and enthusiast programmers.
To preserve the colors, use
From the man page:
|show 1 more comment|
The color information will show up as a bunch escaped characters. In case you want to remove the escaped characters later on, here's a nifty shell command with
(Note, on OS X, use