查看监听(Listen)的端口
netstat -lntp
检查端口被哪个进程占用
netstat -lnp|grep 8080
Centos查看端口占用情况命令,比如查看80端口占用情况使用如下命令:
lsof -i tcp:80
netstat -a
现在当我们直接关闭shell窗口,再连接上服务器,查看Python的进程,发现进程还在
但是,在python运行中却查看不到输出!
因为:
python的输出有缓冲,导致python.log3并不能够马上看到输出。
使用-u参数,使得python不启用缓冲。
所以改正命令,就可以正常使用了
nohup python -u webapp.py >out.log 2>&1 &