php程序员常用Linux命令

1.杀掉某个进程

kill -9 进程ID

2.查找端口被哪个进程占用

lsof -i:端口号
例如,查找9501端口被那个进程占用:lsof -i:9501

3.查找进程

ps -ef | grep xxx

例如,我们运行了一个tp的命令行脚本php think hello,此时我们执行
ps -ef | grep hello
或者
ps -ef | grep think
或者
ps -ef | grep hell
都可以找到该进程

4.查找进程并杀掉

ps -ef | grep xxx | grep -v grep | cut -c 9-15 | xargs kill -9

该命令找到符合xxx的进程(支持多个),并杀掉

5.后台运行某个脚本

nohup php think hello 2>&1 &

 

posted @ 2022-08-05 21:10  右仆射卧龙  阅读(117)  评论(0编辑  收藏  举报