机器人 救救瓜
Toggle navigation
Home
SCM-tool
Linux
Jenkins
SVN
other
About Me
Archives
Tags
Linux grep 常用用法
? linux ?
2019-01-29 16:02:24
542
1
0
gua_l
? linux ?
##grep 查找匹配的行 ###### 匹配单个关键字 ``` cat version_up.sh | grep accu -n 8:#accurev login linchuangfeng $ac_pw 9:#accurev update 10:#accurev pop -R -O $version_file #匹配关键字accu 并带行号印所在行 ``` ---------- ###### 同时满足全部关键字 ``` grep "var1" | grep "var2" [|grep varn] cat version_up.sh | grep accu | grep login ``` ---------- ###### 满足关键字其一 ``` grep -E "var1|var2" ``` ---------- ###### 反选,排除匹配 ``` grep -v "va" grep -v "va\|vb\|vc" # | 前要用转义 ```
Pre:
merge 和cherry pick
Next:
shell 里 sed的用法
1
likes
542
Weibo
Wechat
Tencent Weibo
QQ Zone
RenRen
Submit
Sign in
to leave a comment.
No Leanote account?
Sign up now.
0
comments
More...
Table of content
No Leanote account? Sign up now.