快速查找常用Linux命令

系统服务管理工具
systemctl [命令] [服务]
  • start: 启动服务
  • stop: 停止服务
  • restart: 重启服务
  • status: 查看服务状态
  • enable: 设置开机自启
  • systemctl status nginx: 查看nginx服务状态
  • systemctl restart apache2: 重启apache2服务
  • 查看服务状态:`systemctl status xxx`;开机自启:`systemctl enable xxx`。
  • 日志排障配合:`journalctl -u xxx -n 200 --no-pager`。