嵌入式培训
达内IT学院
400-996-5531
嵌入式相关的grep/awk/sed的多条件查询的分析:
# cat gt
one two three
four five six
one two
one seven three
# grep one three gt
grep: three: No such file or directory
gt:one two three
gt:one two
gt:one seven three
截取同时出现one和three的行,结果应该是:
one two three
one seven three
1. 用grep
cat gt | grep one | grep three
2. 用awk
awk '/one/&&/three/' gt
3. 用sed
sed -ne '/one/' gt
完毕
如果更好的解释请提供给达内培训技术小编。
填写下面表单即可预约申请免费试听!怕钱不够?可就业挣钱后再付学费! 怕学不会?助教全程陪读,随时解惑!担心就业?一地学习,可全国推荐就业!
Copyright © 京ICP备08000853号-56 京公网安备 11010802029508号 达内时代科技集团有限公司 版权所有
Tedu.cn All Rights Reserved