linux服务器的几个常用指令

来源:互联网 发布:python实现矩阵相乘 编辑:程序博客网 时间:2024/06/05 08:01

复制文件:

cp -p phpcms.conf cms.conf


查看源里相关软件有几个版本:

apt-cache show package-name


nginx -s reload  :修改配置后重新加载生效
nginx -s reopen  :重新打开日志文件
nginx -t -c /path/to/nginx.conf 测试nginx配置文件是否正确

关闭nginx:
nginx -s stop  :快速停止nginx
         quit  :完整有序的停止nginx

其他的停止nginx 方式:

ps -ef | grep nginx

kill -QUIT 主进程号     :从容停止Nginx
kill -TERM 主进程号     :快速停止Nginx
pkill -9 nginx          :强制停止Nginx



启动nginx:
nginx -c /path/to/nginx.conf

平滑重启nginx:
kill -HUP 主进程号

0 0