In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to check the system time on linux. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
The method to check the system time: 1, execute the "date" command; 2, execute the "uptime" command; 3, execute the "w" command; 4, execute the "who" command; 5, execute the "last root-F | head-1 | awk'{print $4, 5, 5, 5, 5, 5, 5, 5, 5, 4, 5, 5, 7, 7, 8}'" commands.
The operating environment of this tutorial: CentOS 6 system, Dell G3 computer.
1 、 date
This is the most classic command for the system to view time, and it is also the life that scripts often use to define time.
[root@localhost ~] $dateFri Jan 25 14:17:17 CST 2019
2 、 uptime
[root@localhost] # uptime16:51:24 up 13:02, 1 user, load average: 0.00,0.01,0.05
The first data of this command is the current time of the system, the second is the running time of the system, and the third is the average of the system load in the past 1 minute, 5 minutes and 15 minutes after the number of logged in users of the system.
3 、 w
Up 1983 days, 13:05, 2 users, load average: 26.45,27.76, 27.72USER TTY FROM LOGIN@ IDLE JCPU PCPU WHATgdmm81 pts/0 10.153.97.38 14:09 23.00s 0.36s 0.01s sshd: gdmm81 [priv] dwtangmi pts/3 10.153.97.56 17:18 0.00s 0.07s 0.01s sshd: dwtangmingqi [priv]
The W command note is to look at the currently logged-in users of the system, what each user is doing, and the impact of all active loads on the computer. This command combines the results of uptime, who, and ps-a
Of course, there are other options for this command. You can study the ways to use it sometime.
W commands the first column, which is the same as uptime.
The second column of the w command is the current logged in user of the system
User: login user name
TTY: the terminal number assigned by the system after login
From: remote hostname, that is, where you logged in
When will login@: log in
IDLE: user idle time. This is a timer, and once the user performs any action, the change timer is reset.
JCPU: all processes connected to the terminal take time. Including the time occupied by currently running background jobs
PCPU: time spent by the current process
WHAT: the command line of the currently running process
4 、 who
[modps@gd-mopps02] $whogdmm81 pts/0 2019-01-18 14:09 (10.153.97.38) dwtangmingqi pts/3 2019-01-18 17:18 (10.153.97.56)
The who command is somewhat similar to the w command, and my command contains more information.
5 、 last
Last lists users who have recently logged in to the system
[root@localhost ~] # last root-F | head-1 | awk'{print $4, "5 laws, 7" 8 "Fri Jan 18 14:55:52 2019, this is the end of the article on" how to check system time in linux ". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.