service 命令詳解


service 命令用於管理 Ubuntu 係統服務。

這個命令不是在所有 Linux 發行版本中都有。 主要是在 Redhat、Fedora、Mandriva 和 Centos 中。 Ubuntu 新版本有引入。

Ubuntu 老版本要實現類似功能,語法類似這樣:

/etc/init.d/nginx start|stop|restart

基本用法     詳細用法

service nginx start
			

基本語法

service < option>| --status-all | [ service_name [ command | --full-restart ] ]
			

基本用法

功能 命令 文字解釋 示例 示例解釋
啓動 service service_name start 啓動名為 service_name 的服務
停止 service service_name stop 停止名為 service_name 的服務
重啓 service service_name restart 重啓名為 service_name 的服務
重載 service service_name reload 重載名為 service_name 的服務 service nginx reload 重載 nginx 服務
查看 service service_name status 查看名為 service_name 的服務狀態 service nginx status 查看 nginx 服務狀態
幫助 shred --help 展示幫助信息

 

版權聲明: 本文為獨傢原創稿件,版權歸 樂數軟件 ,未經許可不得轉載。