RHCSA简单实用Linux

RHCSA简单实用Linux
day11.查看 root 用户家目录的目录内容[roothaha ~]# ls /rootanaconda-ks.cfg2、以长列表格式查看 tmp 目录的内容[roothaha ~]# ls /tmp -l总用量 0drwx------ 3 root root 17 7月 21 14:34 systemd-private-e01a46e4fc9c4d16bff8c80040d91f21-chronyd.service-YMwmcOdrwx------ 3 root root 17 7月 21 14:34 systemd-private-e01a46e4fc9c4d16bff8c80040d91f21-dbus-broker.service-Mdx9CLdrwx------ 3 root root 17 7月 21 14:34 systemd-private-e01a46e4fc9c4d16bff8c80040d91f21-irqbalance.service-lTa4jidrwx------ 3 root root 17 7月 21 14:34 systemd-private-e01a46e4fc9c4d16bff8c80040d91f21-kdump.service-rkKIe1drwx------ 3 root root 17 7月 21 14:34 systemd-private-e01a46e4fc9c4d16bff8c80040d91f21-systemd-logind.service-T7gxj2drwx------ 2 root root 6 7月 21 14:24 vmware-root_898-2722239165drwx------ 2 root root 6 7月 21 14:22 vmware-root_899-3988097379drwx------. 2 root root 6 7月 19 11:32 vmware-root_900-2722108090drwx------ 2 root root 6 7月 21 14:34 vmware-root_901-3988228452drwx------ 2 root root 6 7月 19 12:00 vmware-root_902-2730562360drwx------ 2 root root 6 7月 19 12:02 vmware-root_904-2697008433drwx------. 2 root root 6 7月 19 11:28 vmware-root_918-26975327123、查看普通用户的家目录的所有内容[roothaha ~]# ls -a /home/redhat/. .. .bash_history .bash_logout .bash_profile .bashrc4、切换到 log 目录log 目录在 /var 下并且查看当前目录[roothaha ~]# cd /var/log[roothaha log]# pwd/var/log5、以年 - 月 - 日 时分: 秒 的格式显示当前时间[roothaha ~]# date %Y-%m-%d %H:%M:%S2026-07-21 14:47:326、只查看当前的星期[roothaha ~]# date %A星期二7、查看当前的时区[roothaha ~]# timedatectl statusLocal time: 二 2026-07-21 14:50:58 CSTUniversal time: 二 2026-07-21 06:50:58 UTCRTC time: 二 2026-07-21 06:50:59Time zone: Asia/Shanghai (CST, 0800)System clock synchronized: noNTP service: activeRTC in local TZ: no8、从 redhat 用户切换到 root 用户并且切换的时候切换家目录[redhathaha ~]$ su - root密码[roothaha ~]# pwd/root9、通过 --help 查看 date 命令的帮助信息并找到命令格式是啥[roothaha ~]# date --help用法date [选项]... [格式]或date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]以给定格式字符串的形式显示当前时间或者设置系统日期。10、修改自己的主机名为自己名字的缩写[roothaha ~]# hostnamectl hostname hyl[roothaha ~]# hostnamectlStatic hostname: hylIcon name: computer-vmChassis: vm ??Machine ID: 684a3a9229ef43e3a67adfa72b2922f9Boot ID: e01a46e4fc9c4d16bff8c80040d91f21Virtualization: vmwareOperating System: Red Hat Enterprise Linux 9.8 (Plow)CPE OS Name: cpe:/o:redhat:enterprise_linux:9::baseosKernel: Linux 5.14.0-687.5.3.el9_8.x86_64Architecture: x86-64Hardware Vendor: VMware, Inc.Hardware Model: VMware Virtual PlatformFirmware Version: 6.00