grep 笔记
-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 笔记的更多相关文章
- grep笔记
grep "match_text" file1 file2 file3 ... #grep可以对多个文件进行过滤 --color ...
- cut printf awk sed grep笔记
名称 作用 参数 实例 cut 截取某列,可指定分隔 -f 列号 -d 分隔符 cut -d ":" -f 1, 3 /etc/passwd 截取第一列和第三列 printf pr ...
- Linux文本检索命令grep笔记
grep是在linux系统中基于行文本非常实用检索工具,通过该命令可以将匹配到的结果信息输出到终端控制台. 语法格式:grep [-ivnc] '需要匹配的内容' 文件名 常用参数说明: -i 检索的 ...
- 【Linux】grep笔记
Linux grep命令用于查找文件里符合条件的字符串. 参数: -a 或 --text : 不要忽略二进制的数据. -A<显示行数> 或 --after-context=<显示行数 ...
- sed、grep、awk -- 三剑客笔记记录
sed常用操作笔记 1.删除文件最后一行: sed -i '$d' filename 2.递归替换内容:sed -i 's/内容A/内容B/g' filename sed -i "s/S ...
- linux笔记:搜索命令find,locate,which,whereis,grep
命令名称:find功能:文件搜索命令所在路径:/bin/find用法:find 搜索范围 匹配条件其他:举例:find /root -name initfind /root -size +1024fi ...
- linux shell编程学习笔记(二) --- grep命令
Linux系统中grep命令是一种强大的文本搜索工具,它能使用正则表达式搜索文本,并把匹 配的行打印出来.grep全称是Global Regular Expression Print,表示全局正则表达 ...
- linux下grep命令笔记
grep -i 不区分大小写 --color 添加颜色 alias grep=‘grep --color=auto’ -v 显示没有被模式匹配到的行 -o 只显示 ...
- grep, egrep, fgrep笔记
grep, egrep, fgrep grep: 根据模式搜索文本,并将符合模式的文本行显示出来.Pattern: 文本字符和正则表达式的元字符组合而成匹配条件 grep [options] PATT ...
随机推荐
- volatile和synchronized实现内存可见性的区别
先看看synchronized实现内存可见性 加锁(synchronized同步)的功能不仅仅局限于互斥行为,同时还存在另外一个重要的方面:内存可见性.我们不仅希望防止某个线程正在使用对象状态而另一个 ...
- ceph mimc版本ceph-deploy安装与配置
系统环境centos7.6 内核5.0.9 YUM源配置 [root@k8s-sys-10-82-4-200 ceph-cluster]# cat /etc/yum.repos.d/ceph.repo ...
- 腾讯2019年暑期实习生招聘提前批在线笔试技术研究和数据分析方向t2(python)
小Q有一叠纸牌,一共有n张,从上往下依次编号为1~n.现在小Q要进行以下重复操作:把位于顶端的牌扔掉,把新的顶端的牌放到这叠牌的底部.小Q会一直操作到只剩下一张牌为止,小Q想知道每次扔掉的牌的编号.[ ...
- XWIKI离线WAR包部署(LDAP登录)
背景 接任务部署一个wiki, 要求: java语言开发, 开源, 内网部署; 需要支持: 大文件上传(300m左右), 所见即所得(wycwyg), 导出, LDAP, 评论与权限. 通过一个好用的 ...
- robotframework 连接mysql数据库
1.安装databaselibrary.pymysql 通过cmd命令执行:pip install robotframework-databaselibrary 通过cmd命令执行:pip insta ...
- vuex状态管理
msvue组件间通信时,若需要改变多组件间共用状态的值.通过简单的组件间传值就会遇到问题.如:子组件只能接收但改变不了父组件的值.由此,vuex的出现就是用作各组件间的状态管理. 简单实例:vuex的 ...
- ci框架nginx访问
url:http://localhost:20082/index.php/welcome/index 问题:apache环境下可以访问,nginx环境下不可以
- Unity Button事件的简洁处理
看到很多人依然还是通过最原始的方法给button绑定事件并处理,这种通过Find往子集一个个的查找,获取到后再绑定事件这种操作很费事,有些人则是对查找对象写了个方法自动往子集遍历更方便获取对象,但还是 ...
- python 练习2
购物订单系统: #!usr/bin/env python # encoding: utf-8 import sys i = 0 inventory_dic = {'Car':1000,'SUV':50 ...
- 创建和管理SQL Server数据库
1.创建数据库 右击“数据库”,在弹出的快捷菜单中选择“新建数据库”选项 2.分离和附加数据库 分离:右击数据库"MySchool",在弹出的快捷菜单中选择“任务”—“分离”选项 ...