Linux系統下檢視系統時間和硬體時間

2021-08-20 19:53:56 字數 1587 閱讀 7055

1.具體命令使用如下:

檢視當前系統時間

[root@littlelawson hbase-1.4.0]# date

monjun

1810:36

:45pdt2018

設定系統時間

[root@littlelawson hbase-1.4.0]# date -s 21:48:00

monjun

1821:48

:00pdt2018

檢視當前硬體時間

[root@littlelawson hbase-1.4.0]# hwclock

mon18

jun2018 09:51:

01pm

pdt -0.969901 seconds

設定硬體時間,'月/日/年 時分'

[root@littlelawson hbase-1.4.0]# hwclock --set --date='06/18/18 21:50'

[root@littlelawson hbase-1.4.0]# hwclock --systohc

[root@littlelawson hbase-1.4.0]# hwclock

damon 18

jun2018 09:52:

23pm

pdt -0.391427 seconds

[root@littlelawson hbase-1.4.0]# date

monjun

1821:52

:23pdt2018

2.關於hwclock[hardware clock]命令
-s, --hctosys

set the system time from

the hardware clock.#以硬體時間為標準,設定系統時間

also set

the kernel』s timezone value

tothe

local timezone as

indicated by

the tz environment variable

and/or

/usr/share/zoneinfo, as tzset(3) would interpret them. the

obsolete tz_dsttime field of

the kernel』s timezone value is

setto dst_none. (for details on

what

this

field

used

to mean, see settimeofday(2).)

this is a good option to use in

oneof

thesystem startup

scripts.

-w, --systohc

set the hardware clock to

the current system time.##以系統時間為標準,設定硬體時間

檢視和修改linux系統時間

一 檢視和修改linux的時區1.檢視當前時區 命令 date r 2.修改設定linux伺服器時區方法 a 命令 tzselect 方法 b 僅限於redhat linux 和 centos 命令 timeconfig 方法 c 適用於debian 命令 dpkg reconfigure tzda...

Linux 檢視當前時間和修改系統時間

1.檢視當前時區 命令 date r 2.修改設定linux伺服器時區 方法 a 命令 tzselect 方法 b 僅限於redhat linux 和 centos 命令 timeconfig 方法 c 適用於debian 命令 dpkg reconfigure tzdata 3.複製相應的時區檔案...

linux下檢視系統資訊

uname a 檢視核心 作業系統 env 檢視環境變數 head n 1 etc issue 檢視作業系統版本 free m 檢視記憶體使用量和交換分割槽使用量 uptime 檢視系統執行時間 使用者數 負載 ifconfig 看到網路介面屬性 fdisk l 檢視所有分割槽資訊 iptables...