-a :将 binary 文件以 text 文件的方式搜寻数据
-c :计算找到 '搜寻字符串' 的次数
-i :忽略大小写的不同,所以大小写视为相同
-n :顺便输出行号
-v :反向选择,亦即显示出没有 '搜寻字符串' 内容的那一行!
--color=auto :可以将找到的关键词部分加上颜色的显示喔!
-r
-w 全子匹配
-E 使用egrep功能,多字匹配

grep -E? ?'aaaaa|bbbbbb'

grep -E 'SIGNAL|OFL Hit'

logcat -s MiSysSrv MiMwIptvSrv MiMwTvosSrv

logcat -c;logcat  -v time -s  ld-linux.so.3 MiSysSrv | grep -v 'mi_display_GetSourceType|mi_atom_display_GetSourceType'

logcat -c;logcat  -v time -s  ld-linux.so.3 MiSysSrv | grep -v '<<<mi_'

-v time -s  ld-linux.so.3 | grep -E 'u32Brightness|sharpness_t'

grep -E? ?'aaaaa|bbbbbb'

grep -nriE 'SVCMGR|APMLIB' ok.txt

logcat -c;logcat | grep -v 'tvos|RootActivity|TvManager_JNI'

logcat -c;logcat | grep -v 'tvos' | grep -v 'RootActivity' | grep -v 'TvManager_JNI'

--color

如果类似于含有”test、auto_load”之类的文件我也不显示,怎么做呢?我之前的做法是:
grep -r "UserService" ./ | grep -v "svn\|prj\|test\|auto_load"

http://www.cnblogs.com/chenwenbiao/archive/2011/10/11/2206870.html

WATCHDOG kill

grep -nriE 'coredump' *

grep -nriE 'MiSysSrv|ServiceManager|MiMwIptvSrv' [69]_AC_console_otto.huang_20170214-110209.log
grep -nriE 'MiSysSrv|ServiceManager|MiMwIptvSrv' [81]_AC_console_otto.huang_20170207-165002.log

grep -nriE 'kill|died|coredump' [81]_AC_console_otto.huang_20170207-165002.log

I/ServiceManager( 1199): service 'mstar.miSi' died

grep -nrE 'sn init-chk#6|AC_ON|Launching|Enter SetVideoMute|Unmute' *

grep -nriE 'kill|died|coredump' *

grep -nriE 'ServiceManager|AudioSystem|MiSysSrv|MiMwIptvSrv|AudioManager|Waiting for' log.txt

grep -nriE 'AudioSystem|MiMwIptvSrv|AudioManager|Waiting for' log.txt

grep -nriE 'kill|died|coredump|MiSysSrv' str*

grep -nriE 'died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal' *

grep -nriE 'died|coredump|terminated|dump_backtrace|assert|fatal|MiSysSrv|bootvideo' *

grep -nriE 'start ub|finish boot' *

grep -nriE 'MStar STR waiting power off...|MStar STR Resuming...|A N D R O I D' *

grep -nriEa 'AC_Off|AC_On|logcat|A N D R O I D|MStar STR Resuming...|MStar STR waiting power off|finish boot|Boot animation finish|SurfaceFlinger' *

grep -nriEa 'A N D R O I D|Boot animation finish' *

grep -nr AC_Off
AC_On
logcat

grep -nriE 'MiSysSrv|bootvideo' *

find -name '*.h' | xargs grep -nr pt_regs

AC

logcat -s AndroidRuntime Process

logcat -c;logcat | grep -nrE 'StatusBar|AndroidRuntime|Process'

grep -nriE 'fail|MiSysSrv|anr|watchdog|fatal|' *

#######################
grep -nriE 'died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG' *

logcat -c;logcat |

grep -nrE 'WindowManager|dispatchKeyEvent' *

grep -nrE '1337|1184|1173' log.txt

grep -nrE 'A N D R O I D |PowerManagerService|LightsHAL|MiSysSrv|MStar STR Resuming...|MStar STR waiting power off|PowerHAL|ShutdownThread' a.log

grep -nrE 'A N D R O I D |PowerManagerService|LightsHAL|MStar STR Resuming...|MStar STR waiting power off|PowerHAL|ShutdownThread' b.log

grep -nrE 'MyDialog|interceptKeyTi' 0915-7.log

PowerManagerService

LightsHAL

MiSysSrv

grep -nriE 'dispatchKeyEventdied|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...' *

grep -nriE 'died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|is Null\, please connect!' * | grep -v Debug | grep -v debug

lowmemorykiller: Killing
#######################
grep -anriE 'PowerOn|PowerManager|Starting kernel|Power Down|ShutdownThread|LightsHAL|Watchdog|interceptKeyTi|dispatchKeyEvent|PowerManagerService|FATAL|AndroidRuntime|Process :|died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|MStar STR waiting power off|is Null\, please connect!|lowmemorykiller: Killing|held by |ANR' * |
grep -v Debug | grep -v debug  |
grep -anriE 'PowerOn|PowerManager|Starting kernel|Power Down|ShutdownThread|LightsHAL|Watchdog|interceptKeyTi|dispatchKeyEvent|PowerManagerService|FATAL|AndroidRuntime|Process :|died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|MStar STR waiting power off|is Null\, please connect!|lowmemorykiller: Killing|held by |ANR'
#######################
grep -anriE 'PowerOn|PowerManager|Starting kernel|Power Down|ShutdownThread|LightsHAL|Watchdog|interceptKeyTi|dispatchKeyEvent|PowerManagerService|FATAL|Process :|died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|MStar STR waiting power off|is Null\, please connect!|lowmemorykiller: Killing|held by |ANR' * |
grep -v Debug | grep -v debug  |
grep -anriE 'PowerOn|PowerManager|Starting kernel|Power Down|ShutdownThread|LightsHAL|Watchdog|interceptKeyTi|dispatchKeyEvent|PowerManagerService|FATAL|Process :|died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|MStar STR waiting power off|is Null\, please connect!|lowmemorykiller: Killing|held by |ANR'
#######################
grep -anriE 'Starting kernel|Power Down|ShutdownThread|LightsHAL|Watchdog|interceptKeyTi|dispatchKeyEvent|PowerManagerService|FATAL|Process :|died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|MStar STR waiting power off|is Null\, please connect!|lowmemorykiller: Killing|held by |ANR' * |
grep -v Debug | grep -v debug  |
grep -anriE 'Starting kernel|Power Down|ShutdownThread|LightsHAL|Watchdog|interceptKeyTi|dispatchKeyEvent|PowerManagerService|FATAL|Process :|died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|MStar STR waiting power off|is Null\, please connect!|lowmemorykiller: Killing|held by |ANR'

grep -anriE 'Power Down|ShutdownThread|LightsHAL|Watchdog|interceptKeyTi|dispatchKeyEvent|PowerManagerService|FATAL|AndroidRuntime|Process :|died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|MStar STR waiting power off|is Null\, please connect!|lowmemorykiller: Killing|held by |ANR' * |
grep -v Debug | grep -v debug  |
grep -anriE 'Power Down|ShutdownThread|LightsHAL|Watchdog|interceptKeyTi|dispatchKeyEvent|PowerManagerService|FATAL|AndroidRuntime|Process :|died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|MStar STR waiting power off|is Null\, please connect!|lowmemorykiller: Killing|held by |ANR'
#######################
#######################
grep -anriE 'dispatchKeyEvent|PowerManagerService|FATAL|AndroidRuntime|Process :|died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|MStar STR waiting power off|is Null\, please connect!|oom_adj|lowmemorykiller|held by |ANR' * |
grep -v Debug | grep -v debug  |
grep -anriE 'dispatchKeyEvent|PowerManagerService|FATAL|AndroidRuntime|Process :|died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|MStar STR waiting power off|is Null\, please connect!|oom_adj|lowmemorykiller|held by |ANR'
#######################
grep -anriE 'died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|MStar STR waiting power off|is Null\, please connect!|oom_adj|lowmemorykiller|held by |ANR' 0622650.log |
grep -v Debug | grep -v debug  |
grep -anriE 'died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|MStar STR waiting power off|is Null\, please connect!|oom_adj|lowmemorykiller|held by |ANR'

grep -anriE 'died|coredump|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|MStar STR waiting power off|is Null\, please connect!|oom_adj|lowmemorykiller|held by |ANR' |
grep -v Debug | grep -v debug  |
grep -anriE 'died|coredump|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|MStar STR waiting power off|is Null\, please connect!|oom_adj|lowmemorykiller|held by |ANR'

grep -anriE 'died|coredump|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|MStar STR waiting power off|is Null\, please connect!|oom_adj|lowmemorykiller|held by |ANR' * |
grep -v Debug | grep -v debug  |
grep -anriE 'died|coredump|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|MStar STR waiting power off|is Null\, please connect!|oom_adj|lowmemorykiller|held by |ANR'

grep -anriE 'BOEOT|COREDUMP|MiSysSrv' *

grep -anriE 'died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|MStar STR waiting power off|is Null\, please connect!|held by |ANR' * |
grep -v Debug | grep -v debug |
grep -anriE 'died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|A N D R O I D|MStar STR Resuming...|MStar STR waiting power off|is Null\, please connect!|held by |ANR'

grep -anriE 'died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...'
#######################
grep -anriE 'died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|is Null\, please connect!|oom_adj|lowmemorykiller|held by |ANR' * |
grep -v Debug | grep -v debug  |
grep -anriE 'died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|is Null\, please connect!|oom_adj|lowmemorykiller|held by |ANR'
KILL
PowerManagerService
#######################

grep -anriE 'died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|A N D R O I D|MStar STR Resuming...|is Null\, please connect!|held by ' *

grep -anriE 'died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|is Null\, please connect!|oom_adj|lowmemorykiller|held by|MiMwIptvSrv' * |
grep -v Debug | grep -v debug  |
grep -anriE 'died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|is Null\, please connect!|oom_adj|lowmemorykiller|held by|MiMwIptvSrv'

######################
grep -nriE 'died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|is Null\, please connect!|oom_adj|lowmemorykiller|ActivityManager' * |
grep -v Debug | grep -v debug  |
grep -nriE 'died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|is Null\, please connect!|oom_adj|lowmemorykiller|ActivityManager'
#######################

grep -v  'MiSysSrv' * | grep -v 'audio_hw_primary'

grep -v  'MiSysSrv' c2p.txt | grep -v 'audio_hw_primary'

grep -v  'MiSysSrv' log-last.txt | grep -v 'audio_hw_primary'
|
grep -v  'MiSysSrv' log-720.txt | grep -v 'audio_hw_primary'

grep -nriE 'MiSysSrv' *

grep -nirE 'ActivityManager|SystemServer|InputManager|pcapcmcc|KILL|Input   :' b.txt

grep -v  'MiSysSrv'

grep -v  'MiSysSrv' huawei.log | grep -v 'Kernel' > a.txt

grep -v  'MiSysSrv' huawei-1.log | grep -v 'Kernel' > b.txt

grep -v  'HRCS' a.txt b.txt > c.txt

grep -v  'MiSysSrv' a.txt

grep -v  'Kernel' *

| grep -v 'audio_hw_primary'

grep -v  'MiSysSrv' huawei.log | grep -v 'Kernel' > a.txt

grep -nr "MStar STR waiting power off..." *

#######################

grep -nriE '[MsOS_Init]|MsOS_SHM_Init|Hello ZC|MiSysSrv' *

grep -nriE '\[MsOS_Init\]|MsOS_SHM_Init|Hello ZC|MApi_AUTH_Process|MDrv_AUTH_IPCheck' start_1.log

grep -v  'MiSysSrv' * | grep -v 'Kernel' | grep -v  '[MMP]' | grep -v audio_hw_primary

grep -v  '[MMP]' * | grep -v audio_hw_primary | grep -v Downloader

MsOS_SHM_Init should

[MsOS_Init]

A N D R O I D

grep -v  'MiSysSrv' log.txt | grep -v 'apiMMAP' | grep -v MiMwIptvSrv | grep -v Resources | grep -v utopia | grep -v android

grep -nriE 'died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|MiSysSrv' *

grep -nriE 'died|coredump|dump_backtrace|assert|fatal|backtrace|signal|A N D R O I D|MStar STR Resuming...' COM26-662.log

grep -nriE 'died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|is Null\, please connect!' * | grep -v Debug | grep -v debug --color=auto

export XXX="died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|is Null\, please connect\!|oom_adj|lowmemorykiller"
grep -nriE '$XXX'

grep -nriE 'died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|is Null\, please connect!|oom_adj|lowmemorykiller' * |
grep -v Debug | grep -v debug  |
grep -nriE 'died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|is Null\, please connect!|oom_adj|lowmemorykiller'

grep -nriE 'died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|is Null\, please connect!' *

grep -nriE 'died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|MiSysSrv|MiMwIptvSrv' *

grep -nriE 'died|c' *

grep -nriE 'died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|A N D R O I D|MStar STR Resuming...' 041911.log

grep -v  'StreamDataSource' 041201.log.126 | grep -v 'MMP' | grep -v 'mstplayer' | grep -v 'MiSysSrv'

grep -nriE 'died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|A N D R O I D|MStar STR Resuming...' 041901m.log

grep -v  '[MMP]' * | grep -v audio_hw_primary | grep -v Downloader

grep -nriE 'MStar STR Resuming...|2083|ActivityManager|4344' *

grep -v  'MiSysSrv' 041901m.log | grep -v 'MMP' | grep -v 'mstplayer'

grep -nriE 'SurfaceFlinger|finish boot|ActivityManager|PackageManager' c.log

grep -nriE 'SurfaceFlinger|finish boot' c.log

grep -v 'MMP'

grep -v  'MiSysSrv' * | grep -v 'D/'

grep -v 'D/' * | grep -v 'V/' | grep -v 'I/' | grep -v 'E/' | grep -v 'W/'
'
grep -nriE 'died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|MiSysSrv|MiMwIptvSrv' *  | grep -v '\[INFO\]'

grep -nriE 'died|coredump|terminated|dump_backtrace|assert|fatal|backtrace|signal|DEBUG|A N D R O I D|MStar STR Resuming...|is Null\, please connect!' 426.log

grep -nrE 'DEBUG' 041911.log

logcat -c;logcat | grep -v 'MiSysSrv'

grep -nriE 'System.err' *

grep -nriE 'fail|MiSysSrv|anr|watchdog|fatal|System.err' *

grep -nriE 'mediaplayer' *

grep 笔记的更多相关文章

  1. grep笔记

    grep "match_text" file1 file2 file3 ...                        #grep可以对多个文件进行过滤 --color   ...

  2. cut printf awk sed grep笔记

    名称 作用 参数 实例 cut 截取某列,可指定分隔 -f 列号 -d 分隔符 cut -d ":" -f 1, 3 /etc/passwd 截取第一列和第三列 printf pr ...

  3. Linux文本检索命令grep笔记

    grep是在linux系统中基于行文本非常实用检索工具,通过该命令可以将匹配到的结果信息输出到终端控制台. 语法格式:grep [-ivnc] '需要匹配的内容' 文件名 常用参数说明: -i 检索的 ...

  4. 【Linux】grep笔记

    Linux grep命令用于查找文件里符合条件的字符串. 参数: -a 或 --text : 不要忽略二进制的数据. -A<显示行数> 或 --after-context=<显示行数 ...

  5. sed、grep、awk -- 三剑客笔记记录

    sed常用操作笔记   1.删除文件最后一行: sed -i '$d' filename 2.递归替换内容:sed -i 's/内容A/内容B/g' filename sed -i "s/S ...

  6. linux笔记:搜索命令find,locate,which,whereis,grep

    命令名称:find功能:文件搜索命令所在路径:/bin/find用法:find 搜索范围 匹配条件其他:举例:find /root -name initfind /root -size +1024fi ...

  7. linux shell编程学习笔记(二) --- grep命令

    Linux系统中grep命令是一种强大的文本搜索工具,它能使用正则表达式搜索文本,并把匹 配的行打印出来.grep全称是Global Regular Expression Print,表示全局正则表达 ...

  8. linux下grep命令笔记

    grep    -i 不区分大小写    --color 添加颜色        alias grep=‘grep --color=auto’    -v 显示没有被模式匹配到的行    -o 只显示 ...

  9. grep, egrep, fgrep笔记

    grep, egrep, fgrep grep: 根据模式搜索文本,并将符合模式的文本行显示出来.Pattern: 文本字符和正则表达式的元字符组合而成匹配条件 grep [options] PATT ...

随机推荐

  1. ES6学习笔记(数组)

    1.扩展运算符:, 2, 3]) // 1 2 3 console.log(1, ...[2, 3, 4], 5) // 1 2 3 4 5 用于函数调用 function add(x, y) { r ...

  2. 学习日记--用Vector(向量)实现动态数组

    Vector的使用方法: 能在添加元素时增加长度的数组称为动态数组或可变长数组.相对地,必须事先指定长度,只能容纳一定数量元素的数组称为静态数组.下面分享一下如何借助STL(标准模板库)中的Vecto ...

  3. jsp4

    SESSION ID=B564A2D318ECDF70EB94C6DE2080E951 SESSION ID=B564A2D318ECDF70EB94C6DE2080E951 SESSION ID=B ...

  4. Python学习笔记6函数和代码复用

    1.函数 (1)定义: (2)函数调用 (3)函数的参数传递 参数传递的两种方式:函数调用时,参数可以按照位置或名称的方式传递 (4)函数的返回值 (5)局部变量和全局变量 (6)lambda函数 2 ...

  5. docker容器composer 部署 laravel框架

    首先yum install docker     安装docker service docker start   启动docker docker pull  docker.io/skiychan/ng ...

  6. webpack4.0

    1. webpack 刚开始是js的模块打包,现在是一个任何模块打包工具  可以识别 CommonJS引入规范     CMD AMD 2. commonJS:  module.exports   r ...

  7. Win10下windows mobile设备中心连接不上的方法无法启动

    微软Win10自动更细补丁后windows mobile设备中心就无法启动了 需要重新启动相关的服务并授予 本机登录用户 权限 1.点击屏幕左下角“开始”图标,点击“运行”,在弹出的输入框中输入“se ...

  8. selenium启动谷歌浏览器

    谷歌浏览器可以是任意版本. 根据谷歌浏览器的版本,下载响应的浏览器驱动(百度:谷歌驱动与谷歌浏览器版本映射表). 我用的是win7 ,下载win32就行了.下载解压之后可以放在python的安装目录下 ...

  9. [转]vue跨域解决方法

      vue跨域解决方法 vue项目中,前端与后台进行数据请求或者提交的时候,如果后台没有设置跨域,前端本地调试代码的时候就会报“No 'Access-Control-Allow-Origin' hea ...

  10. skynet记录2:模块简介

    稍后填坑 bson.so  client.so  lpeg.so  md5.so  skynet.so  sproto.so gate.so  harbor.so  logger.so  snlua. ...