Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to colorize findstr output in cmd?

Tags:

windows

adb

cmd

In linux the grep output gets highlighted in red. Is there any special command to achieve the same using findstr in Windows cmd?

I am trying this command in cmd - adb logcat -v time | findstr /a:color [4] \"NETWORK" but in return it says specify only /L or /R.

(While Googling I learnt that /a is for color formatting and 4 stands for Red color)

I need to search for "NETWORK" calls my Android app is making. To view the logs better, it would be helpful if the output of findstr gets colorized.

like image 989
Sudar Avatar asked Oct 30 '22 17:10

Sudar


1 Answers

You can use the color attribute as follows findstr /s /n /a:e /i "<your search string>" <file paths>. Note that /a:<color code> is the option you are looking for. Here's an example:

findstr with color example

Here are the list of colors available. I am using 'e' or 'E' or 'Light Yellow':

Colors available in cmd

like image 71
user3613932 Avatar answered Nov 09 '22 08:11

user3613932