1.手动输入timedatectl set-timezone Asia/Shanghai更改时区
[root@localhost ~]# [root@localhost ~]# timedatectl set-timezone Asia/Shanghai
如果时间还不对,手动输入timedatectl set-time 年份-月份-日期
[root@localhost ~]# timedatectl set-time 年份-月份-日期
再输入时间
[root@localhost ~]# timedatectl set-time 时:分
查看系统时间
[root@localhost ~]# timedatectl status
Local time: Sat 2022-07-30 19:02:23 CST
Universal time: Sat 2022-07-30 11:02:23 UTC
RTC time: Sat 2022-07-30 11:02:23
Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
将日期写入time文件
[root@localhost ~]# touch time.txt
[root@localhost ~]# nano /time
[root@localhost ~]# cat /time
Local time: Sat 2022-07-30 19:02:23 CST
查看主机/etc/下是否存在group文件,是什么类型文件
[root@localhost ~]# ll -dl /etc/group
-rw-r--r--. 1 root root 981 Jul 31 2022 /etc/group
-普通文件
查看/etc/sysconfig目录文件的属性
[root@localhost ~]# stat /etc/sysconfig
File: /etc/sysconfig
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: fd00h/64768d Inode: 50589121 Links: 5
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Context: system_u:object_r:etc_t:s0
Access: 2022-07-31 02:46:08.363000078 +0800
Modify: 2022-07-31 02:45:31.043000072 +0800
Change: 2022-07-31 02:45:31.043000072 +0800
Birth: 2022-07-31 02:38:08.686000011 +0800
创建root用户家目下创建file文件,在pub创建该文件的软连接文件newfile,在/test创建硬链接文件file.lnk
[root@localhost ~]# ln -s /pub/newfile /t1
[root@localhost ~]# ll /t1
lrwxrwxrwx. 1 root root 12 Jul 30 20:34 /t1 -> /pub/newfile
[root@localhost ~]# ln /test /file.lnk
[root@localhost ~]# ll -i /test /file.lnk
1545390 lrwxrwxrwx. 1 root root 5 Jul 30 20:49 /file.lnk -> /test
在文件中编辑内容
[root@localhost ~]# echo good good study day day up > file
[root@localhost ~]# cat file
good good study day day up