1.
#永久修改主机名
[root@localhost ~]# hostnamectl set-hostname rhcsa
[chongyang@rhcsa ~]#
2.
#在/home/和/root目录下面创建file1文件和dir1目录
[root@rhcsa chongyang]# mkdir /root/dir1
[root@rhcsa chongyang]# mkdir /home/dir1
[root@rhcsa chongyang]# touch /root/file1
[root@rhcsa chongyang]# touch /home/file1
3.
#在/home/file1文件里面写入内容he11o,we1come to home
[root@rhcsa chongyang]# echo hello >> /home/file1
[root@rhcsa chongyang]# echo welcome to home >> /home/file1
[root@rhcsa chongyang]# cat /home/file1
hello
welcome to home
4.
#在/root/file1文件里面写入当前的时间并写入内容this is administrator
[root@rhcsa chongyang]# vim /root/file1
:read!date
2023年 05月 23日 星期二 17:55:57 CST
[root@rhcsa chongyang]# echo this is administrator >> /root/file1
[root@rhcsa chongyang]# cat /root/file1
2023年 05月 23日 星期二 17:55:57 CST
this is administrator
5.
#在/root/dir1目录下面新建文件file2,内容和/root/file1文件内容一样
[root@rhcsa chongyang]# touch /root/dir1/file2
[root@rhcsa chongyang]# cat /root/file1 >> /root/dir1/file2
[root@rhcsa chongyang]# cat /root/dir1/file2
2023年 05月 23日 星期二 17:55:57 CST
this is administrator