Linux修改主机名;查看,设置时间;使用wget下载视频;查看IP

修改主机名:

hostnamectl set-hostname zzzzzz        #修改主机名为:zzzzzz

 查看主机名:

hostname

查看时间:

[root@rhcsa ~]# timedatectl 
               Local time: Sun 2021-11-07 14:01:43 CST
           Universal time: Sun 2021-11-07 06:01:43 UTC
                 RTC time: Sun 2021-11-07 05:59:56
                Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: no
              NTP service: inactive
          RTC in local TZ: no

修改时间:

[root@rhcsa ~]# date "+%Y-%m-%d %H:%M:%S"

查看已知时区:

[root@rhcsa ~]# timedatectl list-timezones 
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
Africa/Blantyre
Africa/Brazzaville
Africa/Bujumbura
Africa/Cairo
Africa/Casablanca
Africa/Ceuta
Africa/Conakry
Africa/Dakar
Africa/Dar_es_Salaam
Africa/Djibouti
......

输出字符串:

[root@rhcsa ~]# echo 'We are leanring RHCSA!'
We are leanring RHCSA!
[root@rhcsa ~]# printf 'we are leanring rhcsa'
we are leanring rhcsa[root@rhcsa ~]#

下载视频:

[root@rhcsa ~]# wget https://www.pearvideo.com/
--2021-11-07 14:14:12--  https://www.pearvideo.com/
Resolving www.pearvideo.com (www.pearvideo.com)... 203.107.47.49
Connecting to www.pearvideo.com (www.pearvideo.com)|203.107.47.49|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘index.html’

index.html                                   [ <=>                                                                               ]  84.17K   445KB/s    in 0.2s    

2021-11-07 14:14:13 (445 KB/s) - ‘index.html’ saved [86193]

查看IP:

[root@rhcsa ~]# ifconfig

Guess you like

Origin blog.csdn.net/weixin_59280309/article/details/121190763