SoFunction
Updated on 2025-04-10

Android filters multiple keyword logs on ubuntu

1 Question

For example, when we look up problems, we need to filter multiple keywords. My usual approach is to execute the following commands in one terminal, and then there are a few keywords and a few terminals. Switch to switch to make it difficult to read the log.

adb logcat | grep ****

2 Improvement methods

Today I saw my colleagues using grep -E. We can filter multiple keywords through the -E parameter, for example

adb logcat | grep -E "word1 | word2"

For example, filter 3

adb logcat | grep -E "word1 | word2 | word3"

Old men, and so on, we need to remember that grep -i ignores upper and lower case filtering logs

adb logcat | grep -i word1

Summarize

The above is the entire content of this article. I hope that the content of this article has certain reference value for your study or work. Thank you for your support. If you want to know more about it, please see the relevant links below