课堂作业1

1.(1)[root@localhost ~]# mkdir test_dir

[root@localhost ~]# cd test_dir
[root@localhost test_dir]# touch test_file.txt
(2)[root@localhost ~]# cp test_dir/test_file.txt  /tmp/copy_of_test.txt

(3)[root@localhost ~]# rm -rf  test_dir

(4)[root@localhost ~]# mkdir test_dir

[root@localhost test_dir]# touch ~/test_dir/test_file.txt

[root@localhost test_dir]# ln -s test_file.txt  soft_link.txt

[root@localhost test_dir]# ln test_file.txt  hard_link.txt

(5)[root@localhost test_dir]# test_file.txt

[root@localhost test_dir]# cat soft_link.txt

软 :提示"没有那个文件或目录"   它存储的是指向原文件的路径。当原文件被删除后,软链接就会失效,无法访问。

硬 :可以正常访问   硬链接指向原来的数据块,故可以访问

2.(1)[root@localhost ~]#  head -n 10 /etc/passwd

(2)[root@localhost ~]#  echo "这是追加的测试内容" >>  copy_of_test.txt 

[root@localhost ~]# cat copy_of_test.txt

(3)[root@localhost ~]# vim copy_of_test.txt

 :%s/测试/练习/g 
 :wq

3.(1)[root@localhost ~]# cd /home 

[root@localhost home]# mkdir /backup

[root@localhost home]# cp /etc/*.conf  /home/backup

(2)[root@localhost ~]# ls /home/backup | wc -l

(3)[root@localhost ~]# tar -zcvf etc_backup.tar.gz /home/backup

[root@localhost ~]#  rm -rf /home/backup

4.(1)[root@localhost ~]# chown user1 : group1 /copy_of_test.txt

(2)[root@localhost ~]# chmod 754 /copy_of_test.txt

(3)[root@localhost ~]# ls -l /copy_of_test.txt

5.(1)[root@localhost ~]# sudo useradd -s /bin/bash newuser1

(2)[root@localhost ~]# sudo groupadd newgroup1

[root@localhost ~]# sudo usermod -aG newgroup1 newuser1

(3)[root@localhost ~]# sudo userdel newuser1

6.(1)[root@localhost ~]# mkdir /perm_test_dir

[root@localhost ~]# touch /perm_test_file.txt

[root@localhost ~]# chmod 750 /perm_test_dir

[root@localhost ~]# chmod 644 /perm_test_file.txt

(2)[root@localhost ~]# chgrp -R newgroup1 /perm_test_dir

(3)[root@localhost ~]# chmod -R 774 /perm_test_dir

7.[root@localhost ~]# mount  /dev/sr0   /mnt

[root@localhost ~]# vim /etc/yum.repos.d/base.repo

[BaseOS]
name=BaseOS  
baseurl=file:///mnt/BaseOS
gpgcheck=0
[AppStream]
name=AppStream
baseurl=file:///mnt/AppStream
gpgcheck=0


[root@localhost ~]# dnf   install   cockpit    -y
[root@localhost ~]# systemctl restart cockpit  
[root@localhost ~]# systemctl stop   firewalld


 


 

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值