文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>grep/awk/sed的多条件查询

grep/awk/sed的多条件查询

时间:2005-08-08  来源:honbj

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/{/three/p}' gt
完毕

相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载