shell 编程–grep

一、数据过滤与正则表达式
用法:
grep [选项] 匹配模式 [文件]
常用选项:
-i 忽略字母大小写。
-v 取反匹配
-w 匹配单词
-q 静默匹配,不将结果显示在屏幕上。

案例:
[root@localhost jiaofan]# cat test.txt #<==文本内容 th The ccc the bbb theabc hello world [root@localhost jiaofan]# grep the test.txt #<==过滤有the的行(区分大小写) the bbb theabc [root@localhost jiaofan]# grep -i the test.txt #<==过滤有the的行(不区分大小写)

shell 编程–grep最先出现在Python成神之路

版权声明:
作者:lichengxin
链接:https://www.techfm.club/p/22536.html
来源:TechFM
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>