当前位置: 首页 > news >正文

dedecms网站地图插件网站备案 做网站

dedecms网站地图插件,网站备案 做网站,网站的特征包括哪些方面,网络营销与管理专业是干什么的一.grep简介 grep 全程Globally search a Regular Expression and Print#xff0c;是一种强大的文本搜索工具#xff0c;它能使用特定模式匹配#xff08;包括正则表达式#xff09;搜索文本#xff0c;并默认输出匹配行。Unix的grep家族包括grep和egrep 二.grep的工作…一.grep简介 grep 全程Globally search a Regular Expression and Print是一种强大的文本搜索工具它能使用特定模式匹配包括正则表达式搜索文本并默认输出匹配行。Unix的grep家族包括grep和egrep 二.grep的工作模式 2.1.grep执行语法 grep [option] file... 2.2.工作方式 grep在一个或者多个文件中搜索字符串模板 如果模板中包括空格需要使用引号引起来 模板后的所有字符串会被看作是文件名 2.3.工作结果 如果模板搜索成功则返回0状态码 如果搜索不成功则返回1状态码 如果搜索的文件不存在则返回2的状态码。 三.grep的常用参数详解 3.1.常用参数详解 3.2.演示示例 a建立测试文件 [roothaha shells]# vim testfile root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbin:/sbin/nologin adm:x:3:4:adm:/var/adm:/sbin/nologin lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin sync:x:5:0:sync:/sbin:/bin/sync shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown halt:x:7:0:halt:/sbin:/sbin/halt mail:x:8:12:mail:/var/spool/mail:/sbin/nologin operator:x:11:0:operator:/root:/sbin/nologin test:root:test test:ROOT:test test:chroot:test test:test:root b过滤文件中所有含有root字符串的行 [roothaha shells]# grep root testfile root:x:0:0:root:/root:/bin/bash operator:x:11:0:operator:/root:/sbin/nologin test:root:test test:chroot:test test:test:rootc 过滤包含 root 单词的行 [roothaha shells]# grep root testfile -w root:x:0:0:root:/root:/bin/bash operator:x:11:0:operator:/root:/sbin/nologin test:root:test test:test:rootd 过滤含有 root 字符的行忽略大小写 [roothaha shells]# grep root testfile -i root:x:0:0:root:/root:/bin/bash operator:x:11:0:operator:/root:/sbin/nologin test:root:test test:ROOT:test test:chroot:test test:test:roote 过滤含有 root 单词和 bash 单词的行 [roothaha shells]# grep -w -e root -e bash testfile root:x:0:0:root:/root:/bin/bash operator:x:11:0:operator:/root:/sbin/nologin test:root:test test:test:rootf 只显示匹配内容不不显示其他并标注行号 [roottiminglee shell]# grep -on root testfile 1:root 1:root 1:root 10:root 11:root 13:root 14:root g 显示包含 root 字符串的行的总数 [roothaha shells]# grep -c root testfile 5h 显示不含有 root 的行 [roothaha shells]# grep -v root testfile bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbin:/sbin/nologin adm:x:3:4:adm:/var/adm:/sbin/nologin lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin sync:x:5:0:sync:/sbin:/bin/sync shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown halt:x:7:0:halt:/sbin:/sbin/halt mail:x:8:12:mail:/var/spool/mail:/sbin/nologin j 显示含有 adm 关键字及其周围的 2 行 [roothaha shells]# grep -2 adm testfile bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbin:/sbin/nologin adm:x:3:4:adm:/var/adm:/sbin/nologin lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin sync:x:5:0:sync:/sbin:/bin/synck显示含有 adm 关键字及其下面 1 行 [roothaha shells]# grep -A1 adm testfile adm:x:3:4:adm:/var/adm:/sbin/nologin lp:x:4:7:lp:/var/spool/lpd:/sbin/nologinl 显示含有 adm 关键字及其上面 2 行 [roothaha shells]# grep -B2 adm testfile bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbin:/sbin/nologin adm:x:3:4:adm:/var/adm:/sbin/nologin四.正则表达式的使用 4.1.什么是正则表达式 正则表达式就是用在字符串的处理上面的一项表示式 在我们做程序设计时很多需要对一类字符进行处理正则表达式就完美的解决了这个问题 4.2.正则表达式  基本正则表达式 Basic Regular Expression BRE 又称为标准正则表达式是最早制订的正则表达式规范仅支持最基本的元字符集。基本正则表达式是POSIX 规范制订的两种正则表达式语法标准之一另外一种语法标准称为扩展正则表达式 扩展正则表达式 Extended Regular Expression ERE 支持比基本正则表达式更多的元字符 在grep命令使用基本正则表达式时不需要加任何参数 在grep命令使用扩展正则表达式时必须加-E参数 示例 a 过滤以 root 开头的行过滤以 root 开头 bash 结尾的行 [roothaha shells]# grep ^root testfile root:x:0:0:root:/root:/bin/bash [roothaha shells]# grep -E (^root|bash$) testfile root:x:0:0:root:/root:/bin/bash [roothaha shells]# b 过滤以 root 结尾的行 [roothaha shells]# grep root$ testfile test:test:rootc 搜索 e 开头 y 结尾的三字符单词搜索 e 开头 y 结尾的四字符单词 [roothaha shells]# grep e.y testfile1 eay eby [roothaha shells]# grep e..y testfile1 eaay ebby eabyd 搜索 e 开头 Y 结尾的所有行 [roothaha shells]# grep e.*y testfile1 eay eby eaay ebby eaaay ebbby eaaaaay ebbbbby eababy eaby eabababye搜索自定次数出现的字符 [roothaha shells]# grep -E e.{2}y testfile1 eaay ebby eaby [roothaha shells]# grep -E e.{,2}y testfile1 eay eby eaay ebby eaby [roothaha shells]# grep -E e.{2,}y testfile1 eaay ebby eaaay ebbby eaaaaay ebbbbby eababy eaby eabababy [roothaha shells]# grep -E e.y testfile1 eay eby eaay ebby eaaay ebbby eaaaaay ebbbbby eababy eaby eabababy [roothaha shells]# grep -E e.?y testfile1 eay eby [roothaha shells]# grep -E e[ab]y testfile1 eay eby [roothaha shells]# grep -E e[^ac]y testfile1 eby [roothaha shells]# grep -E e(ab)y testfile1 eababy eaby eabababy [roothaha shells]# grep -E e(ab)?y testfile1 eaby4.3.正则表达式字符集 示例 [roothaha 1]# touch easyalee easyAlee easy lee easylee easy8lee [roothaha 1]# rm -rf easy[[:digit:]]lee [roothaha 1]# rm -rf easy[[:space:]]lee [roothaha 1]# rm -rf easy[[:lower:]]lee [roothaha 1]# rm -rf easy[[:upper:]]lee [roothaha 1]# rm -rf easy[[:graph:]]lee [roothaha 1]# rm -rf easy[[:alpha:]]lee
http://www.hkea.cn/news/14451448/

相关文章:

  • 在线做logo的网站阿勒泰建设局网站
  • 钦州住房和城乡建设局网站潍坊网站建设收费标准
  • 建设地方美食网站的目的报价表
  • 手机免费网站建设哪家公司好怎么查个人是否注册工商执照
  • 成都网站建设排行榜中国建设招标网是个假网站
  • 风景区网站建设论文范文WordPress如何更改文章链接
  • 怎么做网站图片的切换图洛阳设计公司官网
  • 动易网站中添加邮箱英文网站建设服务合同模板
  • 微信怎么做网站推广商城网站租服务器安全不
  • 南京网站建设 ww网站建设汇报
  • 临西做网站多少钱装潢设计学校
  • 网站建设部署视频教程临沂网站定制
  • 网站做竞价对seo有影响吗东莞高端建站公司
  • 唐山网站建设互众动力营销型网站开发公司
  • 网站开发的功能需求和模块划分项目网络图和关键路径
  • 淮安做网站卓越凯欣wordpress 哪个好用
  • 济南网站建设排名引迈快速开发平台
  • 龙岗网站建设 公司推广金泉网做的山东黄锈石网站有哪些
  • 网站做好了如何发布北京seo网站管理
  • 长春网长春关键词排名站设计商务网站推广技巧包括什么
  • 照片做视频ppt模板下载网站好南京网站制作哪家好
  • 嘉兴网站专业做网站涉及个人隐私
  • jsp企业网站分公司注册流程网上注册
  • 如何用自己网站做大电商wordpress写的网站
  • 南京建设网站首页sketch做网站
  • 网站联盟营销模板网站代理
  • 淮安哪个做网站好点二手车网站模板建设
  • 江苏靖江苏源建设有限公司网站浙江省住房与城乡建设部网站
  • 美容院网站源码天猫网站平面广告
  • 旅游网站前台模板哈尔滨网站建设方案