rhce第一次作业
1.基础文件和目录操作
mkdir test_dir
cd /test_dir
touch test_file.txt
cp ~/test_dir/test_file.txt /tmp/copy_of_test.txt
rm -rf ~/test_dir
ln -s ~/test_dir/test_file.txt ~/test_dir/soft_link.txt
ln ~/test_dir/test_file.txt ~/test_dir/hard_link.txt
2.文件内容查看与编辑
head -n 10 /etc/passwd
echo "这是追加的测试内容">>/tmp/copy_of_test.txt
cat /tmp/copy_of_test.txt
vim copy_of_test.txt
:%s/测试/练习/g
3.综合操作
mkdir /home/backup
cp -f /etc/*.conf /home/backup/
ls /backup | wc -l
tar -zcvf etc_backup.tar.gz /home/backup
rm -rf /home/backup
4.文件权限管理
chown user1:group1 /tmp/copy_of_test.txt
chmod u=rwx,g=rx,o=r /tmp/copy_of_test.txt
ls -l /tmp/copy_of_test.txt
5.用户和用户组基础操作
useradd -s /bin/bash newuser1
groupadd newgroup1
usermod -a -G newgroup1 newuser1
userdel newuser1
6.文件和目录权限设置与修改
mkdir perm_test_dir
touch perm_test_file.txt
chmod 750 ~/perm_test_dir
chmod 644 ~/perm_test_file.txt
chgrp -R newgroup1 ~/perm_test_dir
chmod -R 774 ~/perm_test_dir
7.写出通过dnf安装cockpit的详细过程。
#mount /dev/sr0 /mnt#vim /etc/yum.repos.d/base.repo[BaseOS]
#组名
name=BaseOS
#描述名称
baseurl=file:///mnt/BaseOS
#资源路径
gpgcheck=0
[AppStream]
name=App
baseurl=file:///mnt/AppStream
gpgcheck=0#dnf install cockpit -y#systemctl restart cockpit #systemctl stop firewalldwindow浏览器访问 虚拟机的ip:9090