VI编辑器的使用
一、实验目的:
1. 掌握VI编辑器的启动和退出方法。
2. 掌握VI编辑器中录入文件内容的方法。
3.  掌握VI编辑器的各种编辑命令的使用。
二、实验环境:
1. 计算机一台
2. Fedora Core 6 系统
Fedora Core 6 系统
三、实验步骤:
1、使用vi打开一个新文档,并输入以下两行内容:
Linux is an operating system that was initially created as a hobby by a young student, Linus Torvalds, at the University of Helsinki in Finland. Linus had an interest in Minix, a small UNIX system, and decided to develop a system that exceeded the Minix standards.
The kernel, at the heart of all Linux systems, is developed and released under the GNU General Public License and its source code is freely available to everyone. It is this kernel that forms the base around which a Linux operating system is developed.
2、发出命令显示行号。
3、保存到文件AboutLinux,不退出。
4、删除一句“It is this kernel that forms the base around which a Linux operating system is developed.”。
linux的vi编辑器命令5、查单词“Finland”。
6、把第一行的“Finland”后的内容变成独立的一行。现在共有三行内容。
7、复制第二行的内容到文档的最后。
8、删除第三行的内容。
9、恢复被删除的一行内容。
10、查所有的“Minix”并全部改为“MINIX”。
11、不保存并退出vi。
12、使用vi再次打开文件AboutLinux。应该显示原来的两行内容。
13、在第二行后插入一行“He began his work in 1991 when he released version 0.02 and worked steadily until 1994 when version 1.0 of the Linux Kernel was released.”。
14、保存并退出vi。
15、使用vi再次打开文件AboutLinux,并在文档最后增加一行“More information on the kernel can be found at our sister site, LinuxHQ and at the official Linux Kernel Archives.”。并保存文档后退出。
五、实验结果
用户管理
一、 实验目的:
1.掌握用户添加、用户属性的修改和停止用户的方法。
2.掌握组的添加和属性的修改。
3.掌握文件权限的管理方法。
4. 了解账号管理和查看命令。
二、实验环境:
3. 计算机一台
4. Fedora Core 6 系统
Fedora Core 6 系统
三、实验内容:
1)用终端命令方法((终端命令,图形界面及修改/etc/group,其中修改/etc/group之前最好能先作个备份)新建组group1, group2,group3。
2)更改组group3的GID为103,更改组名为grouptest。
3)删除组grouptest
4) 用终端命令方法 (终端命令,图形界面及修改/etc/passwd, 其中修改/etc/ passwd之前最好能先作个备份)新建用户user1,user2,user3,user4,user5,user6。
其中:user1指定UID为777,目录为/home/user1,初始组为group1,为root,指定为/bin/bash
用户名
UID
全称(可有可无)
工作目录
初始组(主要组)
有效组
shell
user1
默认
/home/user1
group1
group2
/bin/bash
user2
默认
Linux
/home/user2
user2
group1
/bin/bash
user3
默认
/home/aaa
group1
/bin/bash
user4
默认
Linux course(与user2作对比)
/home/bbb/bbb(与user3作对比,应先建好目录)
group1
group2
/bin/bash
user5
默认
/home/user5
group2
group1,user1
/bin/bash
user6
660
/home/user6
group2
/bin/csh
 
5)修改用户user1的个人说明(全称)为This is a test,密码过期时间为2010-07-27
6)设置用户user1、user3的密码(自定)。
7)查看自己的相关信息(finger root)
8)列出用户user1的UID,GID等(id user1)
9)在/home/user1下新建文件aaa,查看文件属性,并将aaa文件的拥有者设为group1组的user1。
10)查看用户user1的组(groups user1),并切换到user1,同时也改变环境变量。
11)新建文件bbb、ccc,查看文件属性。
12)为bbb文件设置访问权限,拥有者rwx,所属组r,其他者x,并查看文件属性。
13)用另一种方式为ccc文件设置访问权限,拥有者rx,所属组w,其他者-,试着用vi编辑器打开文件。
14)了解账号管理和查看命令whoami,who, finger等。
15)将用户切换为user3,来查看/home/user1下的文件ccc,试着用vi编辑器打开文件,对比与在user1用户名登录时的区别。

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。