vim操作 与文件操作以及文件查看

(1) 应用vi命令在/tmp文件夹下创建文件,文件名newfile。在newfile首行输入日期时间

[root@localhost tmp]# vi /tmp/newfile

在首行输入时间

2,将/boot/grub2/grub.cfg文档的内容读入到newfile文档中(在日期的下一行即第2行)

在vi模式下输入'':",进入命令模式,输入r /boot/grub2/grub.cfg 即可

3.查找文档中包含#号字符的行,将整行删除

:g/^#/d

4. 开启VI的行号提示功能

:set nu

2.文件查看:查看newfile文件的第6行

3.查找文件 /usr/share/xml/xml.xsd 中包含字符串 re 的所有行。将所有这些行的副本按原始顺序放在文件/root/files 中

[root@localhost /]# grep re  /usr/share/xml/xml.xsd  > /root/files
[root@localhost /]# cat /root/files
<?xml-stylesheet href="../../2008/09/xsd.xsl" type="text/xsl"?>
      See <a href="http://www.w3.org/XML/1998/namespace.html">
      <a href="http://www.w3.org/TR/REC-xml">
      Note that local names in this namespace are intended to be
      The names currently defined in this namespace are listed below.
      See further below in this document for more information about <a
      href="#usage">how to refer to this schema document from your own
      XSD schema documents</a> and about <a href="#nsversioning">the
       any element; its value is inherited.  This name is reserved
      Attempting to install the relevant ISO 2- and 3-letter
      going to be a realistic possibility.  
      See BCP 47 at <a href="http://www.rfc-editor.org/rfc/bcp/bcp47.txt">
      and the IANA language subtag registry at
      <a href="http://www.iana.org/assignments/language-subtag-registry">
       http://www.iana.org/assignments/language-subtag-registry</a>
     <xs:restriction base="xs:string">
     </xs:restriction>
       value is inherited.  This name is reserved by virtue of its
   <xs:restriction base="xs:NCName">
    <xs:enumeration value="preserve"/>
   </xs:restriction>
       provides a URI to be used as the base for interpreting any
       relative URIs in the scope of the element on which it
       appears; its value is inherited.  This name is reserved
      href="http://www.w3.org/TR/xmlbase/">http://www.w3.org/TR/xmlbase/</a>
       should be interpreted as if declared to be of type ID.
       This name is reserved by virtue of its definition in the
      href="http://www.w3.org/TR/xml-id/">http://www.w3.org/TR/xml-id/</a>
  <xs:attribute ref="xml:base"/>
  <xs:attribute ref="xml:lang"/>
  <xs:attribute ref="xml:space"/>
  <xs:attribute ref="xml:id"/>
      the original XML Working Group.  This name is reserved by 
    In appreciation for his vision, leadership and
    February, 2000, reserves for Jon Bosak in perpetuity
     <pre>
     </pre>
     <pre>
     </pre>
      Subsequently, qualified reference to any of the attributes or the
      group defined below will have the desired effect, e.g.
     <pre>
           &lt;attributeGroup ref="xml:specialAttrs"/>
     </pre>
      <a href="http://www.w3.org/2009/01/xml.xsd">
      <a href="http://www.w3.org/2001/xml.xsd">
      The schema document at that URI may however change in the future,
      in order to remain compatible with the latest version of XML
      document at <a href="http://www.w3.org/2001/xml.xsd">
      <a href="http://www.w3.org/2009/01/xml.xsd">
      Previous dated (and unchanging) versions of this schema 
      document are at:
      <li><a href="http://www.w3.org/2009/01/xml.xsd">
      <li><a href="http://www.w3.org/2007/08/xml.xsd">
      <li><a href="http://www.w3.org/2004/10/xml.xsd">
      <li><a href="http://www.w3.org/2001/03/xml.xsd">
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

不会取名余

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值