[root@caoxl ~]# uname -a Linux caoxl 3.10.0-862.9.1.el7.x86_64#1 SMP Mon Jul 1616:29:36 UTC 2018x86_64x86_64x86_64 GNU/Linux
# 或者 lsb_release -a
查询硬件信息
查看CPU使用情况:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
[root@caoxl ~]# sar -u 5 10 Linux 3.10.0-862.9.1.el7.x86_64 (caoxl) 08/24/2018 _x86_64_ (1 CPU)
10:26:12 AM CPU %user %nice %system %iowait %steal %idle 10:26:17 AM all 0.20 0.00 0.20 0.00 0.00 99.60 10:26:22 AM all 0.00 0.00 0.20 0.00 0.00 99.80 10:26:27 AM all 0.40 0.00 0.20 0.00 0.00 99.40 10:26:32 AM all 0.20 0.00 0.00 0.80 0.00 99.00 10:26:37 AM all 0.20 0.00 0.20 0.00 0.00 99.60 10:26:42 AM all 0.20 0.00 0.20 0.00 0.00 99.60 10:26:47 AM all 0.00 0.00 0.00 0.00 0.00 100.00 10:26:52 AM all 0.20 0.00 0.00 0.00 0.00 99.80 10:26:57 AM all 0.20 0.00 0.20 0.00 0.00 99.60 10:27:02 AM all 0.20 0.00 0.20 0.00 0.00 99.60 Average: all 0.18 0.00 0.14 0.08 0.00 99.60
# 安装pagesize [root@caoxl ~]# yum search pagesize Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile ===================================== Matched: pagesize ====================================== libhugetlbfs-utils.x86_64 : Userspace utilities for configuring the hugepage environment
[root@caoxl ~]# yum install -y libhugetlbfs-utils
显示架构:
1 2
[root@caoxl ~]# arch x86_64
设置系统时间
显示当前系统时间:
1 2
[root@caoxl ~]# date Fri Aug 2410:31:05 CST 2018
设置系统日期和时间(格式为2018-8-24 10:30:00):
1 2 3
date -s 2018-8-2410:30:00 date -s 2018-8-24 date -s 10:30:00
设置时区:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
选择时区信息。命令为:tzselect 根据系统提示,选择相应的时区信息。
[root@caoxl ~]# tzselect Please identify a location so that timezone rules can be set correctly. Please select a continent or ocean. 1) Africa 2) Americas 3) Antarctica 4) Arctic Ocean 5) Asia 6) Atlantic Ocean 7) Australia 8) Europe 9) Indian Ocean 10) Pacific Ocean 11) none - I want to specify the timezoneusing the Posix TZ format.
强制把系统时间写入CMOS(这样,重启后时间也正确了):
1
[root@caoxl ~]# clock -w
设置系统时间需要root用户权限.
格式化输出当前日期时间:
1 2
[root@caoxl ~]# date +%Y%m%d.%H%M%S 20180824.103400