页面“CentOS7修改系统默认时区”与“Centos7 systemctl基础用法”之间的差异

来自linux中国网wiki
(页面间的差异)
跳到导航 跳到搜索
(导入1个版本)
 
(导入1个版本)
 
第1行: 第1行:
== timedatectl==
+
<pre>
在 CentOS 7 中, 引入了一个叫 timedatectl 的设置设置程序
+
centos 7启动方式
  
timedatectl set-timezone Asia/Shanghai
 
  
其实不考虑各个发行版的差异化, 从更底层出发的话, 修改时间时区比想象中要简单:
+
   centos6使用的是/etc/rc.d/init.d/functions启动centos7使用的是systemd启动
   cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
+
  systemd启动脚本方式
 +
  systemctl enable httpd.service #自启动某服务
 +
  systemctl disable httpd.service #禁用开机启动
 +
  systemctl status httpd.service #查看服务状态
 +
  systemctl list-units --type=service #查看所有服务
 +
 
 +
  systemctl start httpd.service
 +
  systemctl stop httpd.service
 +
  systemctl restart httpd.service
 +
 
 +
  systemctl is-enabled httpd #直看httpd服务是否开机启动
 +
 
 +
  也可以用于管理系统重启系统
 +
  systemctl reboot关闭系统
 +
  systemctl poweroffCPU停止工作systemctl halt暂停系统
 +
  systemcti suspend休眠
 +
  systemctl hibernate进入救援模式-单用模式systemctl rescue
  
这个也是很常用的,一个个选择 不用去记住什么 ,特别是不常用的泰国时区等等
+
</pre>
tzselect
 
  
==参考==
+
[[Nginx on centos7]]
  
[https://my.oschina.net/imhuayi/blog/800202  CentOS7 修改系统默认时区]
+
[[Centos7初始化]]
[https://blog.imdst.com/guo-bf/ Linux 全球常用时区 localtime 对照表]
+
[[category:linux]][[category:ops]]
 
 
[[category:centos]] [[category:ops]]
 

2019年10月14日 (一) 13:48的最新版本

centos 7启动方式


  centos6使用的是/etc/rc.d/init.d/functions启动centos7使用的是systemd启动
  systemd启动脚本方式
  systemctl enable httpd.service #自启动某服务
  systemctl disable httpd.service #禁用开机启动
  systemctl status httpd.service #查看服务状态
  systemctl list-units --type=service #查看所有服务
  
  systemctl start httpd.service
  systemctl stop httpd.service
  systemctl restart httpd.service
  
  systemctl is-enabled httpd #直看httpd服务是否开机启动
  
  也可以用于管理系统重启系统
  systemctl reboot关闭系统
  systemctl poweroffCPU停止工作systemctl halt暂停系统
  systemcti suspend休眠
  systemctl hibernate进入救援模式-单用模式systemctl rescue

Nginx on centos7

Centos7初始化