logcat 怎么使用grep过滤多个字段?要求输出每个字段所在的log。

vivien2004 2015-10-26 10:49:06
比如下面几行log,P2P_FIND和Reject在不同的log中,现在想利用logcat和grep时时输出所有包含这两个字段的log,请问各位大侠该怎么实现?logcat | grep P2P_FIND | grep Reject行不行?
急需!多谢!

01-02 01:59:08.371 D/wpa_supplicant( 2362): p2p-dev-wlan0: Control interface command 'P2P_FIND 120'
01-02 01:59:08.371 D/wpa_supplicant( 2362): P2P: Starting find (type=0)
01-02 01:59:08.371 D/wpa_supplicant( 2362): P2P: p2p_scan is already running
01-02 01:59:08.371 D/wpa_supplicant( 2362): P2P: Clear timeout (state=SEARCH)
01-02 01:59:08.371 D/wpa_supplicant( 2362): wpa_driver_set_ap_wps_p2p_ie: Entry
01-02 01:59:08.371 D/wpa_supplicant( 2362): P2P: State SEARCH -> SEARCH
01-02 01:59:08.371 I/wpa_supplicant( 2362): p2p-dev-wlan0: P2P: Reject scan trigger since one is already pending
01-02 01:59:08.371 D/wpa_supplicant( 2362): CTRL_IFACE monitor sent successfully to /data/misc/wifi/sockets/wpa_ctrl_1637-2\x00
01-02 01:59:08.371 D/wpa_supplicant( 2362): P2P: Failed to start p2p_scan - another p2p_scan was already running
...全文
2539 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
vivien2004 2015-11-16
  • 打赏
  • 举报
回复
logcat | grep -e aaa -e bbb -e ccc

50,545

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧