linux - grep 的模式和使用方法 - patterns
访问量: 2265
1. 查看某个日志中的数字 dddd - dddddd ms 这样的模式。
cat cms_production_2013-02-20.log | grep 'in [0-9]\{4,6\}ms' find ' in xxxms' logs.
2. 多次查询
grep -e 条件1 -e 条件2 . -r (在当前目录下查询 两个条件的字符串)
3. 反向查询
tail access.log -f | grep -vE "source=api|zhiguo|123.119.xx.188|ws"