码迷,mamicode.com
首页 > 系统相关 > 详细

shell常用命令

时间:2018-07-26 18:47:56      阅读:214      评论:0      收藏:0      [点我收藏+]

标签:info   pre   pid   前端   net   art   shel   image   nginx   

PM2:

启动  -----  pm2 start ./bin/www --watch
停止  -----  pm2 stop app_name|app_id
显示日志---- pm2 logs 

 

查看端口占用情况,并强制释放占用的端口

 有时候关闭软件后,后台进程死掉,导致端口被占用。

1.查找被占用的端口

  1.netstat -tln

2.查看端口属于哪个程序?端口被哪个进程占用

  lsof -i:8060

3.杀掉占用端口的进程  根据pid杀掉

  kill -9 进程id  

 

nginx服务:

停止网络服务器,可以输入:
    sudo service nginx stop
启动网络服务器,输入:
    sudo service nginx start
停止,然后再次启动服务器,输入:
     sudo service nginx restart
重启:
    service nginx reload

查看nginx进程:

  技术分享图片

查看当前端口:

  技术分享图片

 

  

shell常用命令

标签:info   pre   pid   前端   net   art   shel   image   nginx   

原文地址:https://www.cnblogs.com/thing/p/9372828.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!