首先,确定任务要求
1.使用timedatectl查看时间状态,并列出所有已知时区,修改时区为列出时区的某一个
2.使用wget命令在https://www.pearvideo.com/这个网站下载任意一个视频
3.Linux中的文件类型以及符号的表示
4.创建目录test,并使用一条命令在test下创建 test1/test2/test3
a.输出test3的完整路径
b.在上面创建的test3目录下创建 file1 并修改文件的修改时间为 20220319
c.查看file1的详细信息
一,查看时间状态及时区,并且修改时区
[root@bogon ~]# timedatectl status
Local time: 日 2022-03-20 18:48:16 CST
Universal time: 日 2022-03-20 10:48:16 UTC
RTC time: 日 2022-03-20 10:48:16
Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: no
NTP service: inactive
RTC in local TZ: no
[root@bogon ~]# timedatectl set-timezone "America/New_York"
[root@bogon ~]# timedatectl status
Local time: 日 2022-03-20 06:50:34 EDT
Universal time: 日 2022-03-20 10:50:34 UTC
RTC time: 日 2022-03-20 10:50:34
Time zone: America/New_York (EDT, -0400)
System clock synchronized: no
NTP service: inactive
RTC in local TZ: no
二,使用wget命令在网站下载一个视频
[root@bogon ~]# wget https://www.pearvideo.com/video_1755372
--2022-03-20 19:07:26-- https://www.pearvideo.com/video_1755372
正在解析主机 www.pearvideo.com (www.pearvideo.com)... 203.107.47.49
正在连接 www.pearvideo.com (www.pearvideo.com)|203.107.47.49|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:未指定 [text/html]
正在保存至: “video_1755372”
video_1755372 [ <=> ] 31.26K --.-KB/s 用时 0.08s
2022-03-20 19:07:27 (376 KB/s) - “video_1755372” 已保存 [32007]
[root@bogon ~]# ls
公共 模板 视频 图片 文档 下载 音乐 桌面 anaconda-ks.cfg baidu.html dcs index.html index.html.1 initial-setup-ks.cfg parent test video_1755372
三,Linux中的文件类型以及符号的表示
文件类型
1. 普通文件:一个普通的文件:视频,音频,文本等等
2. 目录文件: 指的是目录
3. 链接文件:符号链接,用于不同目录下的文件共享, 指向另一个文件
4. 设备文件:
块设备:就是我们的磁盘
字符设备:按照字符进行操作的终端 tty, 键盘
5. 管道文件:主要用于进程间数据的传递
6. 套接字文件:主要应用于网络数据连接
7. 隐藏文件:就是在文件名称的前边加.,以.开始的文件的名,被认为是隐藏文件。必须使用-a选项的ls命令。
符号表示
d: directory : 目录,目录文件
-: 普通文件
l: link 链接文件 /bin/sh -> bash => 类似于一个快捷方式
b: block: 块,块设备文件
c: character: 字符, 字符设备文件
p: pipe: 管道,管道文件
s: socket: 套接字, 套接字文件。
四,创建目录test,并用一条命令创建test1/test2/test3
[root@bogon ~]# mkdir test
[root@bogon ~]# cd test
[root@bogon test]# mkdir -p test1/test2/test3
[root@bogon test]# ls -R
.:
test1
./test1:
test2
./test1/test2:
test3
./test1/test2/test3:
a,输出test3的完整路径,如上
b,test3上创建file1,并修改文件时间为20220319
[root@bogon test3]# mkdir file1
[root@bogon test3]# touch 20220319 file1
[root@bogon test3]# ls -l
总用量 0
-rw-r--r--. 1 root root 0 3月 20 19:35 20220319
drwxr-xr-x. 2 root root 6 3月 20 19:35 file1
c,查看file1的详情信息
root@bogon test3]# stat file1
文件:file1
大小:6 块:0 IO 块:4096 目录
设备:fd00h/64768d Inode:17680075 硬链接:2
权限:(0755/drwxr-xr-x) Uid:( 0/ root) Gid:( 0/ root)
环境:unconfined_u:object_r:admin_home_t:s0
最近访问:2022-03-20 19:35:18.896841761 +0800
最近更改:2022-03-20 19:35:18.896841761 +0800
最近改动:2022-03-20 19:35:18.896841761 +0800
创建时间:2022-03-20 19:31:29.643828153 +0800