实验要求
(1)查找host开头的文件
/usr/share/rhel/secrets/redhat.repo
(2)在/etc下查找host开头的文件
(因为/etc不存在文件,所以图片截图用/opt下的文件代替)
find /etc -name "host*"
(3)查找/usr/share/rhel.xml 中包含re的所有行并存放到/root/files中
(文件夹中不存在rhel.xml)
(文件存在于 /usr/share/rhel/secrets/redhat.repo
运行结果用 /usr/share/rhel/secrets/redhat.repo代替)
grep re /usr/share/rhel.xml > /root/files
(4)打包压缩/etc下的文件
tar -czf /back/etcback.tar.gz /etc
(5)权限设置
groupadd p1
useradd redhat
touch redht.txt
chown redhat:g1 redht.txt