2

I want to issue a logcat command to filter logs specifying a keyword (say apk). But I am facing an issue where the grep command is not recognized on one of my windows 7 PC. The same command works perfectly on other PC with same configuration.

Command issued on windows command prompt :

adb logcat | grep apk  

Output :

'grep' is not recognized as an internal or external command,operable program or batch file.

Output of working setup :

01-01 00:00:41.212  1598  2192 W PackageParser: No actions in intent filter at /system/priv-app/GoogleRestore/GoogleRestore.apk Binary XML file line #94
01-01 00:00:41.228  1598  2193 W PackageParser: No actions in intent filter at /system/priv-app/Contacts/Contacts.apk Binary XML file line #443

Need help in knowing the delta between two PCs. And how can I get the same command working on other PC as well.

K7AAY
  • 9,512
  • 4
  • 33
  • 62
Ashish Chauhan
  • 21
  • 1
  • 1
  • 2
  • 3
    Either one of them has `grep` installed and the other doesn't, or one has `grep` in the default `PATH` and the other doesn't. – RalfFriedl Oct 30 '18 at 19:21
  • Would you please be so kind as to run PATH on both machine HAPPY and machine SAD, and to post the results above by clicking on the `edit` link above and to the left? And, please also do `C: && CD \ && dir /s grep.exe` {Enter} on each PC and post the results by the same means. – K7AAY Oct 30 '18 at 23:34

1 Answers1

1

Instead of using grep, may I suggest the native windows command find would work as well in this example?

adb logcat | FIND /I "apk" 
K7AAY
  • 9,512
  • 4
  • 33
  • 62