1.修改当前主机名为rhcsa,设置当前时区为Asia/Shanghai
[root@rhcsa ~]# hostnamectl set-hostname rhcsa
[root@rhcsa ~]# timedatectl set-timezone Asia/Shanghai
2.[rootarhcsa ~]# mkdir -pv /home/dir1
[rootarhcsa ~]# mkdir -pv /root/dir1
[root@rhcsa ~]# touch /home/file1
[root@rhcsa ~]# touch /root/file1
3.在/home/file1文件里面写入内容hello,welcome to home
[root@rhcsa /]# echo hello,welcome to home >> /home/file1
[root@rhcsa /]# cat /home/file1
hello,welcome to home
4.在/root/file1文件里面写入当前的时间并写入内容this is administrator
[root@rhcsa /]# date
2023年 08月 02日 星期三 20:24:38 CST
[root@rhcsa /]# date > /root/file1
[root@rhcsa /]# date '+%F %T' > /root/file1
[root@rhcsa /]# echo "root" >> /root/file1
[root@rhcsa /]# cat /root/file1
2023-08-02 20:26:42
root
[root@rhcsa /]# echo this is administrator >> /root/file1
[root@rhcsa /]# cat /root/file1
2023-08-02 20:26:42
root
this is administrator
5.[rootarhcsa /]# touch/root/dir1/file2
[rootarhcsa /]# cat/root/file1>>/root/file2
rhcsa
最新推荐文章于 2024-10-13 18:57:05 发布