1.在/root目录下创建一个用自己名字全拼的目录(例如:zhangsan)。
[root@bogon ~]# mkdir py1 [root@bogon ~]#
2.将/etc目录及其下所有内容复制到自己名字目录下。
[root@ns ~]# cp -r /etc /py1 [root@ns ~]# cd /py1 [root@ns py1]# ls -l
3.使用命令切换工作路径为/root/名字全拼/etc目录,并查看其下的所以文件。
[root@ns etc]# cd [root@ns ~]# cd /root/py1/etc [root@ns etc]# ls -l
4.查看/root/名字全拼/etc目录下的yum.conf文件的后五行。
[root@ns etc]# tail -n5 yum.conf
5.查看/root/名字全拼/etc目录下的yum.conf文件的前五行。
[root@ns etc]# head -5 yum.conf
6./root/名字全拼/etc目录下的yum.conf文件中搜索字符串yum。
[root@ns etc]# grep yum yum.conf
7.删除“自己名字全拼”目录。
[root@ns ~]# rm -rf py1