Linux命令总结--systemctl命令

1,简介

     systemctl是系统服务管理器,用过centos6的人再用centos7会发现,有很多命令已经不能使用,而centos7中多了新的命令就是systemctl,这是centos7中的一大特点将centos6中的chkconfig和service命令同意归systemctlI进行管理。

2.命令格式

启动服务

systemctl start service

关闭服务

systemctl stop service

 重新启动服务

systemctl restart service  

查看服务器状态

systemctl status service

开机自动开启服务|关闭服务

systemctl enble|disable service 

重新加载服务器配置文件

systemctl reload service

 3.实例

linux systemctl命令实例

  1.启动nfs服务

 

 systemctl start nfs-server.service

  2.设置开机自启动

 systemctl enable nfs-server.service

  3.停止开机自启动

 systemctl disable nfs-server.service

  4.查看服务当前状态

  systemctl status nfs-server.service

  5.重新启动某服务

 

systemctl restart nfs-server.service

  

  6.查看所有已启动的服务

 

 systemctl list -units --type=service
原文地址:https://www.cnblogs.com/hanjiali/p/13940089.html