linux下编辑文件实验,linux操作系统实验vi编辑器的使用

姓名:学号班级:

实验二vi编辑器的使用

一、实验目的

1.掌握Linux系统的vi编辑器

2.掌握Linux系统的文本编辑

二、实验环境

1.Linux软件和计算机

三、实验内容或步骤

(一)实验知识准备

书上p86-89

(二)实验内容

1.在普通用户的目录下创建文件夹ex2,然后进入该目录。

2.输入vi,编辑一个新文件。

3.此文件的内容为:

Search for knowledge, read more, sit on your porch and admire the view without paying attention to your needs.

Spend more time with your family and friends, eat your favorite foods, and visit the places you love.

Life is a chain of moments of enjoyment; not only about survival.

Use your crystal goblets. Do not save your best perfume, and use it every time you feel you want it.

Remove from your vocabulary phrases like "one of these days" or "someday".

Let‘s write that letter we thought of writing "one of these days"!

Let‘s tell our families and friends how much we love them.

Do not delay anything that adds laughter and joy to your life.

Every day, every hour, and every minute is special.

And you don‘t know if it will be your last.

将文件存盘为exam21.txt。

4.退出vi。

5.用vi打开文件exam21.txt,,然后退出。

6.复制/root/install到当前目录,文件名为exam22.txt。

7.用vi打开文件exam22.txt。

8.使用复制、剪切。粘贴、取消、修改等命令,查看效果。

9.在文件exam22.txt中查找“linux”。

10.将文件exam22.txt的第5行到第20行的内容保存到文件exam23.txt中。

11.将文件exam22.txt的第23行到第28行的内容保存到文件exam24.txt中。

12.从文件exam22.txt中退出,打开文件exam23.txt。

13.将文件exam24.txt的内容读入到文件exam23.txt中。

14.保存并退出文件exam23.txt,查看效果。

15.使用vi创建exam25.txt,将当前系统的时间读入文件exam25.txt,保存退出。

16.用vi打开文件exam21.txt,使用set number看显示结果,使用set nonumber看显示结

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值