linux 常用命令
来源:互联网 发布:淘宝30天历史最低价 编辑:程序博客网 时间:2024/06/16 18:31
匹配多个关键词
用法:grep -E ‘your regular expression’ file
举例:我们拿冰与火之歌第七季第七集的部分字幕举个例子。
GameOfThrones.txt
3000:04:14,370 --> 00:04:19,370{\an8}{\pos(94.16,212.825)}app.YYeTs.com3700:00:08,070 --> 00:00:11,100Little Theon! Come and get her.3800:00:19,300 --> 00:00:22,650It's an invitation... to King's Landing.3900:00:22,650 --> 00:00:25,820You will represent my interests at this gathering as you see them.4000:00:25,820 --> 00:00:28,540It's not safe leaving you with Littlefinger.4100:00:28,540 --> 00:00:29,870She's your sister.
匹配GameOfThrones.txt中含有’sister’或’King’的行
[~/shell]$ grep -E 'sister|King' GameOfThrones.txtIt's an invitation... to King's Landing.She's your sister.
匹配GameOfThrones.txt中含有’sister’或’King’或’Little Theon’的行
注意’Little Theon’中间有个空格,这个时候就要用到正则表达式了Little.Theon,正则表达式中.代表任意字符。
[~/shell]$ grep -E 'sister|King|Little.Theon' grep2.txtLittle Theon! Come and get her.It's an invitation... to King's Landing.She's your sister.
阅读全文
0 0
- 【linux 常用命令】常用命令整理
- linux常用命令
- Linux常用命令
- LINUX 常用命令
- linux常用命令
- Linux 常用命令
- Linux 常用命令
- Linux常用命令
- LINUX常用命令
- Linux 常用命令
- linux常用命令
- Linux常用命令
- Linux常用命令
- Linux 常用命令
- Linux常用命令
- Linux 常用命令
- Linux 常用命令!
- Linux 常用命令
- 【TX1学习与开发系列】(四)如何快速部署多个tx1系统(USB版)
- 为开发者赋能,阿里云大学人才交流市场全新上线!
- MDN JS学习之event
- jmeter解决中文乱码问题
- myeclipse集成JBoss7
- linux 常用命令
- HTTPS系列笔记记录(一):HTTPS 和SSL/TLS协议原理详解
- JavaScript重写alert方法
- 34:求阶乘的和
- github设置ssh
- Set与线程安全
- web测试方法总结
- 从源码层面理解 Either、Option 和 Try
- 字符串拼接