标签:grep
grep精准匹配
cat file
{"aid":45,"path":"attachment/Mon_1112/2_1_5728040df3ab346.jpg"}
想显示aid的值,也就是45
grep -o -E ‘"aid":[0-9]*‘ file
grep对比文件
cat 1
1
2
3
cat 2
1
b
3
找出两个文件相同的内容
grep -Ff 1 2
1
3
找出1里面有,而2里面没有的
grep -vFf 2 1
找出2里面有,而1里面没有的
grep -vFf 1 2
本文出自 “八英里” 博客,请务必保留此出处http://5921271.blog.51cto.com/5911271/1769689
标签:grep
原文地址:http://5921271.blog.51cto.com/5911271/1769689