Filter output of command by color












12















I am running a utility that doesn't offer a way to filter its output. Nothing in the text of the output indicates that a particular function failed but it does show in red. The output is so long that at the end when it reports some # of errors I can't always scroll to see the output where the error occurred.



How can I filter out non-red text?



pseudo code:



dolongtask | grep -color red



Edit



The command outputs other colors as well and I need to be able to filter out all text that isn't red. Also the text coloring is multiline.










share|improve this question




















  • 1





    I apologize for asking the obvious - but all output is on >&1? I mean, the red stuff doesn't go away if you 2>/dev/null, right?

    – mikeserv
    Jun 6 '14 at 1:28


















12















I am running a utility that doesn't offer a way to filter its output. Nothing in the text of the output indicates that a particular function failed but it does show in red. The output is so long that at the end when it reports some # of errors I can't always scroll to see the output where the error occurred.



How can I filter out non-red text?



pseudo code:



dolongtask | grep -color red



Edit



The command outputs other colors as well and I need to be able to filter out all text that isn't red. Also the text coloring is multiline.










share|improve this question




















  • 1





    I apologize for asking the obvious - but all output is on >&1? I mean, the red stuff doesn't go away if you 2>/dev/null, right?

    – mikeserv
    Jun 6 '14 at 1:28
















12












12








12


6






I am running a utility that doesn't offer a way to filter its output. Nothing in the text of the output indicates that a particular function failed but it does show in red. The output is so long that at the end when it reports some # of errors I can't always scroll to see the output where the error occurred.



How can I filter out non-red text?



pseudo code:



dolongtask | grep -color red



Edit



The command outputs other colors as well and I need to be able to filter out all text that isn't red. Also the text coloring is multiline.










share|improve this question
















I am running a utility that doesn't offer a way to filter its output. Nothing in the text of the output indicates that a particular function failed but it does show in red. The output is so long that at the end when it reports some # of errors I can't always scroll to see the output where the error occurred.



How can I filter out non-red text?



pseudo code:



dolongtask | grep -color red



Edit



The command outputs other colors as well and I need to be able to filter out all text that isn't red. Also the text coloring is multiline.







grep colors text filter






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 6 '14 at 2:49







km6zla

















asked Jun 6 '14 at 0:18









km6zlakm6zla

16316




16316








  • 1





    I apologize for asking the obvious - but all output is on >&1? I mean, the red stuff doesn't go away if you 2>/dev/null, right?

    – mikeserv
    Jun 6 '14 at 1:28
















  • 1





    I apologize for asking the obvious - but all output is on >&1? I mean, the red stuff doesn't go away if you 2>/dev/null, right?

    – mikeserv
    Jun 6 '14 at 1:28










1




1





I apologize for asking the obvious - but all output is on >&1? I mean, the red stuff doesn't go away if you 2>/dev/null, right?

– mikeserv
Jun 6 '14 at 1:28







I apologize for asking the obvious - but all output is on >&1? I mean, the red stuff doesn't go away if you 2>/dev/null, right?

– mikeserv
Jun 6 '14 at 1:28












2 Answers
2






active

oldest

votes


















15














Switching the color is done through escape sequences embedded in the text. Invariably, programs issue ANSI escape sequences, because that's what virtually all terminals support nowadays.



The escape sequence to switch the foreground color to red is e[31m, where e designates an escape character (octal 033, hexadecimal 1b, also known as ESC, ^[ and various other designations). Numbers in the range 30–39 set the foreground color; other numbers set different attributes. e[0m resets all attributes to their default value. Run cat -v to check what the program prints, it might use some variant such as e[0;31m to first reset all attributes, or e[3;31 to also switch italics on (which many terminals don't support).



In ksh, bash or zsh, you can use $'…' to enable backslash escapes inside the quotes, which lets you type $'e' to get an escape character. Note that you will then have to double any backslash that you want to pass to grep. In /bin/sh, you can use "$(printf \e)" or type a literal escape character.



With the GNU grep -o option, the following snippet filters red text, assuming that it starts with the escape sequence e[31m, ends with either e[0m or e[30m on the same line, and contain no embedded escape sequence.



grep -Eo $'e\[31m[^e]*e\[[03]?m'


The following awk snippet extracts red text, even when it's multiline.



awk -v RS='33' '
match($0, /^[[0-9;]*m/) {
color = ";" substr($0, 2, RLENGTH-2) ";";
$0 = substr($0, RLENGTH+1);
gsub(/(^|;)0*[^03;][0-9]*($|;)/, ";", color);
red = (color ~ /1;*$/)
}
red'


Here's a variation which retains the color-changing commands, which could be useful if you're filtering multiple colors (here red and magenta).



awk -v RS='33' '
match($0, /^[[0-9;]*m/) {
color = ";" substr($0, 2, RLENGTH-2) ";";
printf "33%s", substr($0, 1, RLENGTH);
$0 = substr($0, RLENGTH+1);
gsub(/(^|;)0*[^03;][0-9]*($|;)/, ";", color);
desired = (color ~ /[15];*$/)
}
desired'





share|improve this answer


























  • The awk solution worked for me. Any way to retain color in output?

    – km6zla
    Jun 6 '14 at 2:47











  • @ogc-nick You want all-red output? printf 'e[31m'; awk …; printf 'e[0m'

    – Gilles
    Jun 6 '14 at 2:58











  • Just for whatever color I am filtering for to be retained in the output.

    – km6zla
    Jun 6 '14 at 3:30











  • @ogc-nick See my edit.

    – Gilles
    Jun 6 '14 at 9:23



















6














You can have grep look for control characters, some of which are responsible for making the pretty colors on the terminal.



dolongtask | grep '[[:cntrl:]]'


For example, this echoes a red "test" into grep, which finds it due to it being surrounded by control characters:



$ echo -e '33[00;31mtest33[00m' | grep --color=none '[[:cntrl:]]'
test <-- in red


The --color=none is just to make sure grep does not apply its own colorization to the matched output, but prints the whole line faithfully so that control characters will be interpreted by the shell.






share|improve this answer


























  • Nice. I wonder if one could go further and do something like grep -E $'33[0?[01];31m.+?33[0?0m' or grep -Po '33[0?[01]+;31mK.+?(?=33[0?0m)' to test for red specifically?

    – steeldriver
    Jun 6 '14 at 1:04











  • I started coming up with regexes like the ones you suggest, but before I could get them to work I stumbled upon [[:cntrl:]]. I tested yours and they work for me, ie. matching red and failing to match other colors.

    – savanto
    Jun 6 '14 at 1:10











  • Works great but will match any color. I didn't mention it in the question but many other colors are also output and I just want to see the red stuff. +1 for simple and working code.

    – km6zla
    Jun 6 '14 at 2:38











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f134763%2ffilter-output-of-command-by-color%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









15














Switching the color is done through escape sequences embedded in the text. Invariably, programs issue ANSI escape sequences, because that's what virtually all terminals support nowadays.



The escape sequence to switch the foreground color to red is e[31m, where e designates an escape character (octal 033, hexadecimal 1b, also known as ESC, ^[ and various other designations). Numbers in the range 30–39 set the foreground color; other numbers set different attributes. e[0m resets all attributes to their default value. Run cat -v to check what the program prints, it might use some variant such as e[0;31m to first reset all attributes, or e[3;31 to also switch italics on (which many terminals don't support).



In ksh, bash or zsh, you can use $'…' to enable backslash escapes inside the quotes, which lets you type $'e' to get an escape character. Note that you will then have to double any backslash that you want to pass to grep. In /bin/sh, you can use "$(printf \e)" or type a literal escape character.



With the GNU grep -o option, the following snippet filters red text, assuming that it starts with the escape sequence e[31m, ends with either e[0m or e[30m on the same line, and contain no embedded escape sequence.



grep -Eo $'e\[31m[^e]*e\[[03]?m'


The following awk snippet extracts red text, even when it's multiline.



awk -v RS='33' '
match($0, /^[[0-9;]*m/) {
color = ";" substr($0, 2, RLENGTH-2) ";";
$0 = substr($0, RLENGTH+1);
gsub(/(^|;)0*[^03;][0-9]*($|;)/, ";", color);
red = (color ~ /1;*$/)
}
red'


Here's a variation which retains the color-changing commands, which could be useful if you're filtering multiple colors (here red and magenta).



awk -v RS='33' '
match($0, /^[[0-9;]*m/) {
color = ";" substr($0, 2, RLENGTH-2) ";";
printf "33%s", substr($0, 1, RLENGTH);
$0 = substr($0, RLENGTH+1);
gsub(/(^|;)0*[^03;][0-9]*($|;)/, ";", color);
desired = (color ~ /[15];*$/)
}
desired'





share|improve this answer


























  • The awk solution worked for me. Any way to retain color in output?

    – km6zla
    Jun 6 '14 at 2:47











  • @ogc-nick You want all-red output? printf 'e[31m'; awk …; printf 'e[0m'

    – Gilles
    Jun 6 '14 at 2:58











  • Just for whatever color I am filtering for to be retained in the output.

    – km6zla
    Jun 6 '14 at 3:30











  • @ogc-nick See my edit.

    – Gilles
    Jun 6 '14 at 9:23
















15














Switching the color is done through escape sequences embedded in the text. Invariably, programs issue ANSI escape sequences, because that's what virtually all terminals support nowadays.



The escape sequence to switch the foreground color to red is e[31m, where e designates an escape character (octal 033, hexadecimal 1b, also known as ESC, ^[ and various other designations). Numbers in the range 30–39 set the foreground color; other numbers set different attributes. e[0m resets all attributes to their default value. Run cat -v to check what the program prints, it might use some variant such as e[0;31m to first reset all attributes, or e[3;31 to also switch italics on (which many terminals don't support).



In ksh, bash or zsh, you can use $'…' to enable backslash escapes inside the quotes, which lets you type $'e' to get an escape character. Note that you will then have to double any backslash that you want to pass to grep. In /bin/sh, you can use "$(printf \e)" or type a literal escape character.



With the GNU grep -o option, the following snippet filters red text, assuming that it starts with the escape sequence e[31m, ends with either e[0m or e[30m on the same line, and contain no embedded escape sequence.



grep -Eo $'e\[31m[^e]*e\[[03]?m'


The following awk snippet extracts red text, even when it's multiline.



awk -v RS='33' '
match($0, /^[[0-9;]*m/) {
color = ";" substr($0, 2, RLENGTH-2) ";";
$0 = substr($0, RLENGTH+1);
gsub(/(^|;)0*[^03;][0-9]*($|;)/, ";", color);
red = (color ~ /1;*$/)
}
red'


Here's a variation which retains the color-changing commands, which could be useful if you're filtering multiple colors (here red and magenta).



awk -v RS='33' '
match($0, /^[[0-9;]*m/) {
color = ";" substr($0, 2, RLENGTH-2) ";";
printf "33%s", substr($0, 1, RLENGTH);
$0 = substr($0, RLENGTH+1);
gsub(/(^|;)0*[^03;][0-9]*($|;)/, ";", color);
desired = (color ~ /[15];*$/)
}
desired'





share|improve this answer


























  • The awk solution worked for me. Any way to retain color in output?

    – km6zla
    Jun 6 '14 at 2:47











  • @ogc-nick You want all-red output? printf 'e[31m'; awk …; printf 'e[0m'

    – Gilles
    Jun 6 '14 at 2:58











  • Just for whatever color I am filtering for to be retained in the output.

    – km6zla
    Jun 6 '14 at 3:30











  • @ogc-nick See my edit.

    – Gilles
    Jun 6 '14 at 9:23














15












15








15







Switching the color is done through escape sequences embedded in the text. Invariably, programs issue ANSI escape sequences, because that's what virtually all terminals support nowadays.



The escape sequence to switch the foreground color to red is e[31m, where e designates an escape character (octal 033, hexadecimal 1b, also known as ESC, ^[ and various other designations). Numbers in the range 30–39 set the foreground color; other numbers set different attributes. e[0m resets all attributes to their default value. Run cat -v to check what the program prints, it might use some variant such as e[0;31m to first reset all attributes, or e[3;31 to also switch italics on (which many terminals don't support).



In ksh, bash or zsh, you can use $'…' to enable backslash escapes inside the quotes, which lets you type $'e' to get an escape character. Note that you will then have to double any backslash that you want to pass to grep. In /bin/sh, you can use "$(printf \e)" or type a literal escape character.



With the GNU grep -o option, the following snippet filters red text, assuming that it starts with the escape sequence e[31m, ends with either e[0m or e[30m on the same line, and contain no embedded escape sequence.



grep -Eo $'e\[31m[^e]*e\[[03]?m'


The following awk snippet extracts red text, even when it's multiline.



awk -v RS='33' '
match($0, /^[[0-9;]*m/) {
color = ";" substr($0, 2, RLENGTH-2) ";";
$0 = substr($0, RLENGTH+1);
gsub(/(^|;)0*[^03;][0-9]*($|;)/, ";", color);
red = (color ~ /1;*$/)
}
red'


Here's a variation which retains the color-changing commands, which could be useful if you're filtering multiple colors (here red and magenta).



awk -v RS='33' '
match($0, /^[[0-9;]*m/) {
color = ";" substr($0, 2, RLENGTH-2) ";";
printf "33%s", substr($0, 1, RLENGTH);
$0 = substr($0, RLENGTH+1);
gsub(/(^|;)0*[^03;][0-9]*($|;)/, ";", color);
desired = (color ~ /[15];*$/)
}
desired'





share|improve this answer















Switching the color is done through escape sequences embedded in the text. Invariably, programs issue ANSI escape sequences, because that's what virtually all terminals support nowadays.



The escape sequence to switch the foreground color to red is e[31m, where e designates an escape character (octal 033, hexadecimal 1b, also known as ESC, ^[ and various other designations). Numbers in the range 30–39 set the foreground color; other numbers set different attributes. e[0m resets all attributes to their default value. Run cat -v to check what the program prints, it might use some variant such as e[0;31m to first reset all attributes, or e[3;31 to also switch italics on (which many terminals don't support).



In ksh, bash or zsh, you can use $'…' to enable backslash escapes inside the quotes, which lets you type $'e' to get an escape character. Note that you will then have to double any backslash that you want to pass to grep. In /bin/sh, you can use "$(printf \e)" or type a literal escape character.



With the GNU grep -o option, the following snippet filters red text, assuming that it starts with the escape sequence e[31m, ends with either e[0m or e[30m on the same line, and contain no embedded escape sequence.



grep -Eo $'e\[31m[^e]*e\[[03]?m'


The following awk snippet extracts red text, even when it's multiline.



awk -v RS='33' '
match($0, /^[[0-9;]*m/) {
color = ";" substr($0, 2, RLENGTH-2) ";";
$0 = substr($0, RLENGTH+1);
gsub(/(^|;)0*[^03;][0-9]*($|;)/, ";", color);
red = (color ~ /1;*$/)
}
red'


Here's a variation which retains the color-changing commands, which could be useful if you're filtering multiple colors (here red and magenta).



awk -v RS='33' '
match($0, /^[[0-9;]*m/) {
color = ";" substr($0, 2, RLENGTH-2) ";";
printf "33%s", substr($0, 1, RLENGTH);
$0 = substr($0, RLENGTH+1);
gsub(/(^|;)0*[^03;][0-9]*($|;)/, ";", color);
desired = (color ~ /[15];*$/)
}
desired'






share|improve this answer














share|improve this answer



share|improve this answer








edited 28 mins ago









fpmurphy

2,361915




2,361915










answered Jun 6 '14 at 1:17









GillesGilles

538k12810881606




538k12810881606













  • The awk solution worked for me. Any way to retain color in output?

    – km6zla
    Jun 6 '14 at 2:47











  • @ogc-nick You want all-red output? printf 'e[31m'; awk …; printf 'e[0m'

    – Gilles
    Jun 6 '14 at 2:58











  • Just for whatever color I am filtering for to be retained in the output.

    – km6zla
    Jun 6 '14 at 3:30











  • @ogc-nick See my edit.

    – Gilles
    Jun 6 '14 at 9:23



















  • The awk solution worked for me. Any way to retain color in output?

    – km6zla
    Jun 6 '14 at 2:47











  • @ogc-nick You want all-red output? printf 'e[31m'; awk …; printf 'e[0m'

    – Gilles
    Jun 6 '14 at 2:58











  • Just for whatever color I am filtering for to be retained in the output.

    – km6zla
    Jun 6 '14 at 3:30











  • @ogc-nick See my edit.

    – Gilles
    Jun 6 '14 at 9:23

















The awk solution worked for me. Any way to retain color in output?

– km6zla
Jun 6 '14 at 2:47





The awk solution worked for me. Any way to retain color in output?

– km6zla
Jun 6 '14 at 2:47













@ogc-nick You want all-red output? printf 'e[31m'; awk …; printf 'e[0m'

– Gilles
Jun 6 '14 at 2:58





@ogc-nick You want all-red output? printf 'e[31m'; awk …; printf 'e[0m'

– Gilles
Jun 6 '14 at 2:58













Just for whatever color I am filtering for to be retained in the output.

– km6zla
Jun 6 '14 at 3:30





Just for whatever color I am filtering for to be retained in the output.

– km6zla
Jun 6 '14 at 3:30













@ogc-nick See my edit.

– Gilles
Jun 6 '14 at 9:23





@ogc-nick See my edit.

– Gilles
Jun 6 '14 at 9:23













6














You can have grep look for control characters, some of which are responsible for making the pretty colors on the terminal.



dolongtask | grep '[[:cntrl:]]'


For example, this echoes a red "test" into grep, which finds it due to it being surrounded by control characters:



$ echo -e '33[00;31mtest33[00m' | grep --color=none '[[:cntrl:]]'
test <-- in red


The --color=none is just to make sure grep does not apply its own colorization to the matched output, but prints the whole line faithfully so that control characters will be interpreted by the shell.






share|improve this answer


























  • Nice. I wonder if one could go further and do something like grep -E $'33[0?[01];31m.+?33[0?0m' or grep -Po '33[0?[01]+;31mK.+?(?=33[0?0m)' to test for red specifically?

    – steeldriver
    Jun 6 '14 at 1:04











  • I started coming up with regexes like the ones you suggest, but before I could get them to work I stumbled upon [[:cntrl:]]. I tested yours and they work for me, ie. matching red and failing to match other colors.

    – savanto
    Jun 6 '14 at 1:10











  • Works great but will match any color. I didn't mention it in the question but many other colors are also output and I just want to see the red stuff. +1 for simple and working code.

    – km6zla
    Jun 6 '14 at 2:38
















6














You can have grep look for control characters, some of which are responsible for making the pretty colors on the terminal.



dolongtask | grep '[[:cntrl:]]'


For example, this echoes a red "test" into grep, which finds it due to it being surrounded by control characters:



$ echo -e '33[00;31mtest33[00m' | grep --color=none '[[:cntrl:]]'
test <-- in red


The --color=none is just to make sure grep does not apply its own colorization to the matched output, but prints the whole line faithfully so that control characters will be interpreted by the shell.






share|improve this answer


























  • Nice. I wonder if one could go further and do something like grep -E $'33[0?[01];31m.+?33[0?0m' or grep -Po '33[0?[01]+;31mK.+?(?=33[0?0m)' to test for red specifically?

    – steeldriver
    Jun 6 '14 at 1:04











  • I started coming up with regexes like the ones you suggest, but before I could get them to work I stumbled upon [[:cntrl:]]. I tested yours and they work for me, ie. matching red and failing to match other colors.

    – savanto
    Jun 6 '14 at 1:10











  • Works great but will match any color. I didn't mention it in the question but many other colors are also output and I just want to see the red stuff. +1 for simple and working code.

    – km6zla
    Jun 6 '14 at 2:38














6












6








6







You can have grep look for control characters, some of which are responsible for making the pretty colors on the terminal.



dolongtask | grep '[[:cntrl:]]'


For example, this echoes a red "test" into grep, which finds it due to it being surrounded by control characters:



$ echo -e '33[00;31mtest33[00m' | grep --color=none '[[:cntrl:]]'
test <-- in red


The --color=none is just to make sure grep does not apply its own colorization to the matched output, but prints the whole line faithfully so that control characters will be interpreted by the shell.






share|improve this answer















You can have grep look for control characters, some of which are responsible for making the pretty colors on the terminal.



dolongtask | grep '[[:cntrl:]]'


For example, this echoes a red "test" into grep, which finds it due to it being surrounded by control characters:



$ echo -e '33[00;31mtest33[00m' | grep --color=none '[[:cntrl:]]'
test <-- in red


The --color=none is just to make sure grep does not apply its own colorization to the matched output, but prints the whole line faithfully so that control characters will be interpreted by the shell.







share|improve this answer














share|improve this answer



share|improve this answer








edited Jun 6 '14 at 0:31

























answered Jun 6 '14 at 0:25









savantosavanto

40336




40336













  • Nice. I wonder if one could go further and do something like grep -E $'33[0?[01];31m.+?33[0?0m' or grep -Po '33[0?[01]+;31mK.+?(?=33[0?0m)' to test for red specifically?

    – steeldriver
    Jun 6 '14 at 1:04











  • I started coming up with regexes like the ones you suggest, but before I could get them to work I stumbled upon [[:cntrl:]]. I tested yours and they work for me, ie. matching red and failing to match other colors.

    – savanto
    Jun 6 '14 at 1:10











  • Works great but will match any color. I didn't mention it in the question but many other colors are also output and I just want to see the red stuff. +1 for simple and working code.

    – km6zla
    Jun 6 '14 at 2:38



















  • Nice. I wonder if one could go further and do something like grep -E $'33[0?[01];31m.+?33[0?0m' or grep -Po '33[0?[01]+;31mK.+?(?=33[0?0m)' to test for red specifically?

    – steeldriver
    Jun 6 '14 at 1:04











  • I started coming up with regexes like the ones you suggest, but before I could get them to work I stumbled upon [[:cntrl:]]. I tested yours and they work for me, ie. matching red and failing to match other colors.

    – savanto
    Jun 6 '14 at 1:10











  • Works great but will match any color. I didn't mention it in the question but many other colors are also output and I just want to see the red stuff. +1 for simple and working code.

    – km6zla
    Jun 6 '14 at 2:38

















Nice. I wonder if one could go further and do something like grep -E $'33[0?[01];31m.+?33[0?0m' or grep -Po '33[0?[01]+;31mK.+?(?=33[0?0m)' to test for red specifically?

– steeldriver
Jun 6 '14 at 1:04





Nice. I wonder if one could go further and do something like grep -E $'33[0?[01];31m.+?33[0?0m' or grep -Po '33[0?[01]+;31mK.+?(?=33[0?0m)' to test for red specifically?

– steeldriver
Jun 6 '14 at 1:04













I started coming up with regexes like the ones you suggest, but before I could get them to work I stumbled upon [[:cntrl:]]. I tested yours and they work for me, ie. matching red and failing to match other colors.

– savanto
Jun 6 '14 at 1:10





I started coming up with regexes like the ones you suggest, but before I could get them to work I stumbled upon [[:cntrl:]]. I tested yours and they work for me, ie. matching red and failing to match other colors.

– savanto
Jun 6 '14 at 1:10













Works great but will match any color. I didn't mention it in the question but many other colors are also output and I just want to see the red stuff. +1 for simple and working code.

– km6zla
Jun 6 '14 at 2:38





Works great but will match any color. I didn't mention it in the question but many other colors are also output and I just want to see the red stuff. +1 for simple and working code.

– km6zla
Jun 6 '14 at 2:38


















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f134763%2ffilter-output-of-command-by-color%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

濃尾地震

How to rewrite equation of hyperbola in standard form

No ethernet ip address in my vocore2