1.使用timedatectl查看时间状态 列出所有已知时区 修改时区为列出时区的某一个
[root@localhost ~]# timedatectl Local time: Mon 2022-04-11 21:39:52 CST Universal time: Mon 2022-04-11 13:39:52 UTC RTC time: Sun 2022-04-03 07:13:58 Time zone: Asia/Shanghai (CST, +0800) System clock synchronized: no NTP service: inactive RTC in local TZ: no [root@localhost ~]# timedatectl list-timezones # 该命令可以列出所有已知时区 [root@localhost ~]# timedatectl set-timezone "America/New_York" [root@localhost ~]# timedatectl status \ Local time: Mon 2022-04-11 09:46:03 EDT Universal time: Mon 2022-04-11 13:46:03 UTC RTC time: Sun 2022-04-03 07:20:09 Time zone: America/New_York (EDT, -0400) System clock synchronized: no NTP service: inactive RTC in local TZ: no
2.使用wget命令在梨视频官网-做最好看的资讯短视频-Pear Video这个网站下载任意一个视频
[root@localhost ~]# wget https://video.pearvideo.com/mp4/adshort/20220411/cont-1758285-15860104_adpkg-ad_hd.mp4 --2022-04-12 18:55:11-- https://video.pearvideo.com/mp4/adshort/20220411/cont-1758285-15860104_adpkg-ad_hd.mp4 Resolving video.pearvideo.com (video.pearvideo.com)... 219.144.100.225, 219.144.100.224, 219.144.100.219, ... Connecting to video.pearvideo.com (video.pearvideo.com)|219.144.100.225|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 18205895 (17M) [video/mp4] Saving to: ‘cont-1758285-15860104_adpkg-ad_hd.mp4’ cont-1758285-15860104_adpkg-ad_hd.mp4 100%[=============================================================================================================>] 17.36M 1.09MB/s in 15s 2022-04-12 18:55:26 (1.19 MB/s) - ‘cont-1758285-15860104_adpkg-ad_hd.mp4’ saved [18205895/18205895]
3.Linux中的文件类型以及符号的表示
Linux中文件类型有普通文件、目录文件、链接文件、块设备文件、字符设备文件、管道文件、套接字文件。
d:directory,表示目录文件 -:普通文件 l:link,表示链接文件 b:block,表示块设备文件 c:character,表示字符设备文件 p:pipe:表示管道文件 s:socket,表示套接字文件
4.创建目录test,并使用一条命令在test下创建 test1/test2/test3
[root@localhost ~]# mkdir test [root@localhost ~]# cd test [root@localhost test]# mkdir -p test1/test2/test3
a.输出test3的完整路径
[root@localhost test3]# pwd /root/test/test1/test2/test3
b.在上面创建的test3目录下创建 file1 并修改文件的修改时间为 20220319
[root@localhost test3]# touch -d 20220319 file1
c.查看file1的详细信息
[root@localhost test3]# stat file1 File: file1 Size: 0 Blocks: 0 IO Block: 4096 regular empty file Device: fd00h/64768d Inode: 1135736 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root) Context: unconfined_u:object_r:admin_home_t:s0 Access: 2022-03-19 00:00:00.000000000 +0800 Modify: 2022-03-19 00:00:00.000000000 +0800 Change: 2022-04-11 21:56:10.971104264 +0800 Birth: 2022-04-11 21:50:57.521085749 +0800