现有练习题如下:
(1-1)建立文件夹
[root@localhost ~]# vim /tmp/newfile
(1-2)输入时间
(2)
[root@localhost ~]# cat /boot/grub2/grub.cfg >> /tmp/newfile
(3)
:g/#/d
(4)
:set nu
(4)
:5 (在按 o 即可添加空白行)
:%s/timeout=5/time=30 //(6)题修改时间
:%s/root/admin/g //(7)题修改单词
gg >yy >G>p //(8)题
:w /boot/newfile2 //(9)题
第二道大题:
[root@localhost ~]# mkdir /ceshi
[root@localhost ~]# mkdir /ceshi/user
[root@localhost ~]# cp /etc/{passwd,sshadow} /ceshi/user
cp: cannot stat '/etc/sshadow': No such file or directory
[root@localhost ~]# cp /etc/{passwd,shadow} /ceshi/user
[root@localhost ~]# ln /ceshi/user/passwd passwd.bak
[root@localhost ~]# ln -s /ceshi/user/shadow sh.link
第三道大题
[root@localhost ~]#cp /ect/ssh/sshd_config /ceshi/sshd