9久久伊人精品综合,亚洲一区精品视频在线,成 人免费va视频,国产一区二区三区黄网,99国产精品永久免费视频,亚洲毛片多多影院,精品久久久无码人妻中文字幕,无码国产欧美一区二区三区不卡
學(xué)習(xí)啦 > 學(xué)習(xí)電腦 > 操作系統(tǒng) > Linux教程 > linux中g(shù)rep命令的詳細(xì)解釋(2)

linux中g(shù)rep命令的詳細(xì)解釋(2)

時(shí)間: 佳洲1085 分享

linux中g(shù)rep命令的詳細(xì)解釋

  三、linux的grep命令的用法大全

  查找特定字符串并顏色顯示

  [root@ www.linuxidc.com]# grep -n 'the' regular_express.txt --color=auto

  8:I can't finish the test.

  12:the symbol '*' is represented as start.

  15:You are the best is mean you are the no. 1.

  16:The world <Happy> is the same with "glad".

  18:google is the best tools for search keyword.

  反向選擇查找特定字符串并顏色顯示

  [root@ www.linuxidc.com]# grep -vn 'the' regular_express.txt --color=auto

  1:"Open Source" is a good mechanism to develop programs.

  2:apple is my favorite food.

  ......

  忽略大小寫(xiě)查找特定的字符

  [root@ www.linuxidc.com]# grep -in 'the' regular_express.txt

  使用 [] 來(lái)查找集合字符:

  [root@ www.linuxidc.com]# grep -n 't[ae]st' regular_express.txt

  8:I can't finish the test.

  9:Oh! The soup taste good.

  查找有‘oo’字符串

  [root@ www.linuxidc.com]# grep -n 'oo' regular_express.txt

  1:"Open Source" is a good mechanism to develop programs.

  2:apple is my favorite food.

  3:Football game is not use feet only.

  9:Oh! The soup taste good.

  18:google is the best tools for search keyword.

  19:goooooogle yes!

  查找有‘oo’字符串,但是不要前面有g(shù)的,即剔除goo

  [root@ www.linuxidc.com]# grep -n '[^g]oo' regular_express.txt

  2:apple is my favorite food.

  3:Football game is not use feet only.

  18:google is the best tools for search keyword.

  19:goooooogle yes!

  查找非小寫(xiě)字母加oo的內(nèi)容

  [root@ www.linuxidc.com]# grep -n '[^a-z]oo' regular_express.txt

  3:Football game is not use feet only.

  獲取有數(shù)字的一行

  [root@ www.linuxidc.com]# grep -n '[0-9]' regular_express.txt

  5:However, this dress is about $ 3183 dollars.

  15:You are the best is mean you are the no. 1.

  [root@ www.linuxidc.com]# grep -n '[^[:lower:]]oo' regular_express.txt

  3:Football game is not use feet only.

  查詢(xún)以the開(kāi)頭的字符

  [root@ www.linuxidc.com]# grep -n '^the' regular_express.txt

  12:the symbol '*' is represented as start.

  查詢(xún)開(kāi)頭是小寫(xiě)字母的內(nèi)容

  [root@ www.linuxidc.com]# grep -n '^[a-z]' regular_express.txt

  2:apple is my favorite food.

  4:this dress doesn't fit me.

  10:motorcycle is cheap than car.

  12:the symbol '*' is represented as start.

  18:google is the best tools for search keyword.

  19:goooooogle yes!

  20:go! go! Let's go.

  查詢(xún)第一個(gè)字符不是大寫(xiě)的

  [root@ www.linuxidc.com]# grep -n '^[[:lower:]]' regular_express.txt

  2:apple is my favorite food.

  4:this dress doesn't fit me.

  10:motorcycle is cheap than car.

  12:the symbol '*' is represented as start.

  18:google is the best tools for search keyword.

  19:goooooogle yes!

  20:go! go! Let's go.

  查詢(xún)不是以英文開(kāi)頭的字符

  [root@ www.linuxidc.com]# grep -n '^[^a-zA-Z]' regular_express.txt

  1:"Open Source" is a good mechanism to develop programs.

  21:# I am VBird

  查詢(xún)結(jié)尾是小數(shù)點(diǎn)的行的內(nèi)容.

  [root@ www.linuxidc.com]# grep -n '\.$' regular_express.txt

  1:"Open Source" is a good mechanism to develop programs.

  2:apple is my favorite food.

  3:Football game is not use feet only.

  4:this dress doesn't fit me.

  10:motorcycle is cheap than car.

  11:This window is clear.

  12:the symbol '*' is represented as start.

  15:You are the best is mean you are the no. 1.

  16:The world <Happy> is the same with "glad".

  17:I like dog.

  18:google is the best tools for search keyword.

  20:go! go! Let's go.

  查找“空白行”

  [root@ www.linuxidc.com]# grep -n '^$' regular_express.txt

  22:

  通配符.和*的使用,.(小數(shù)點(diǎn))代表一定有一個(gè)任意字符,*代表重復(fù)前一個(gè)到無(wú)窮多次的意思

  [root@ www.linuxidc.com]# grep -n 'g..d' regular_express.txt

  1:"Open Source" is a good mechanism to develop programs.

  9:Oh! The soup taste good.

  16:The world <Happy> is the same with "glad".

  查詢(xún)出現(xiàn)任意數(shù)字的行列

  [root@ www.linuxidc.com]# grep -n '[0-9][0-9]*' regular_express.txt

  5:However, this dress is about $ 3183 dollars.

  15:You are the best is mean you are the no. 1.

  查詢(xún)出現(xiàn)兩個(gè)o的字符串

  [root@ www.linuxidc.com]# grep -n 'o\{2\}' regular_express.txt

  1:"Open Source" is a good mechanism to develop programs.

  2:apple is my favorite food.

  3:Football game is not use feet only.

  9:Oh! The soup taste good.

  18:google is the best tools for search keyword.

  19:goooooogle yes!

  查詢(xún)出現(xiàn)2-5個(gè)o的字符串,后面在接一個(gè)g的字符串

  [root@ www.linuxidc.com]# grep -n 'o\{2,5\}g' regular_express.txt

  18:google is the best tools for search keyword.

  19:goooooogle yes!

  查詢(xún)出現(xiàn)2個(gè)以上o的字符串,后面在接一個(gè)g的字符串

  [root@ www.linuxidc.com]# grep -n 'o\{2,\}g' regular_express.txt

  18:google is the best tools for search keyword.

  19:goooooogle yes!

3635284 主站蜘蛛池模板: 全免费A级毛片免费看无码| 中文字幕av中文字无码亚| 色综合天天综合天天更新| 人妻少妇精品视频专区| 成在人线AV无码免观看| 欧美怡春院一区二区三区| 亚洲国产成人久久一区久久| 午夜福利国产一区二区三区| 男女扒开双腿猛进入爽爽免费看| 国产69精品久久久久99尤物| 日韩精品国产另类专区| 视频一区二区三区四区五区| 国产精品va在线观看无码不卡| 手机在线国产精品| 一本精品99久久精品77| 亚洲欧洲久久激情久av| 野花香视频在线观看免费高清版| 亚洲国产初高中生女av| 白嫩少妇无套内谢视频| 日韩一区在线中文字幕| 99中文字幕精品国产| 少妇人妻偷人偷人精品| 国产黄色带三级在线观看| 久久88香港三级台湾三级播放| 人妻激情偷乱视频一区二区三区 | 国产在线98福利播放视频| 成人午夜福利视频一区二区| 日韩精品有码中文字幕| 午夜激情福利一区二区| 久久人人97超碰人人澡爱香蕉| 国产精品亚洲综合网一区| 2021AV在线无码最新| 人人爽人人爽人人片a免费| 国产91丝袜在线播放动漫| 四川丰满少妇无套内谢| 国产成人亚洲综合| 国产免费一区二区三区在线观看 | 67194熟妇在线观看线路| 中文字幕在线看视频一区二区三区| 国产成人精品无码一区二区老年人 | 人妻熟女一区无中文字幕|