Grep command not found in adb shell

After my phone is connected to the computer via adb, go to adb shell and then type grep to give me

 grep: not found 

Is this a problem with installing my adb or with my phone? How do I get grep to work on my device?

PS: That's why I think this could be a problem with my phone (as opposed to installing adb)
stack overflow
The answer says:

The grep utility cannot be installed on your device.

However, I may have misunderstood this expression. How to make grep work?

+5
source share
2 answers

grep command is not installed by default on your device. If you need to use the grep on your device, you can cross-compile busybox and then call grep under busybox .

However, if you are on Linux or Cygwin , you can execute the output of the command and use grep on the PC to get the desired result, for example

 $ adb shell ps |grep google app_5 279 71 200212 30928 ffffffff 00000000 S com.google.process.gapps app_66 481 71 122804 21632 ffffffff 00000000 S com.google.android.apps.maps app_66 32311 71 120200 20916 ffffffff 00000000 S com.google.android.apps.maps:NetworkLocationService 
+2
source

in your case means that the grep utility can not installed on your device.

install busybox from playstore , then run

 busybox grep 
+1
source

Source: https://habr.com/ru/post/1209751/


All Articles