linux cat查询关键字(日志查询)

cd  /usr/local/tomcat/logs
grep 匹配
-- 匹配1个关键字
cat ccs-all.log | grep '转派过户任务'

-- 同时匹配多个关键字
cat ccs-all.log | grep '转派过户任务' | grep 'test11'
grep -v 反向匹配
-- 匹配不包含
cat ccs-all.log | grep -v '转派过户任务'

-- 匹配不包含
cat ccs-all.log | grep -v '转派过户任务' | grep -v 'test11'
grep -E 同时匹配多个关键字–或关系
-- 匹配 包含 word1 或 word2 的行
cat ccs-all.log | grep -E 'word1|word2'
posted @ 2022-09-21 17:59  亲爱的阿道君  阅读(1039)  评论(0)    收藏  举报