1、vim操作:
(1) 应用vi命令在/tmp文件夹下创建文件,文件名newfile。在newfile首行输入日期时间
(2) 将/boot/grub2/grub.cfg文档的内容读入到newfile文档中(在日期的下一行即第2行)
(3) 查找文档中包含#号字符的行,将整行删除
(4) 开启VI的行号提示功能
2、文件查看:查看newfile文件的第6行
3、查找文件 /usr/share/xml/xml.xsd 中包含字符串 re 的所有行。将所有这些行的副本按原始顺序放在文件/root/files 中
1:
![](https://img-blog.csdnimg.cn/img_convert/ce58b30db300d87a9dfc77f9dfef3c35.png)
![](https://img-blog.csdnimg.cn/img_convert/069bc842ba2f7f5287075e451d9953ec.png)
![](https://img-blog.csdnimg.cn/img_convert/f0467e164164d59fb1666c91f3e8aa21.png)
2:
![](https://img-blog.csdnimg.cn/img_convert/c353c3e5be585ac118a3705b9694f2e6.png)
3:
![](https://img-blog.csdnimg.cn/img_convert/a5862fb12e89a5b0ed0c8de5064d06fb.png)
4:
![](https://img-blog.csdnimg.cn/img_convert/11712db8d51e8a1de7c86edf3de8a9ae.png)
2文件查看:
![](https://img-blog.csdnimg.cn/img_convert/4225881d9b8b087f8d3dc18e058dac5e.png)
3查找文件:
![](https://img-blog.csdnimg.cn/img_convert/1d959468fd12a622491ca714c5de73e3.png)