Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【nohup】永久执行服务命令 #12

Open
Kelichao opened this issue May 31, 2017 · 0 comments
Open

【nohup】永久执行服务命令 #12

Kelichao opened this issue May 31, 2017 · 0 comments

Comments

@Kelichao
Copy link
Owner

Kelichao commented May 31, 2017

1.启动永久命令

# 让服务永久启动,不会因xshell关闭而关闭,完成后记得回车,不要按ctrl + c不然会终止进程。
 nohup node server.js &

2.查看指定端口号信息(pid)

# 查看3033端口的信息
 lsof -i:3033

输出

COMMAND   PID USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
node    30594 root   10u  IPv6 28189403      0t0  TCP *:pdb (LISTEN)

3.杀进程kill

#后面跟pid
kill -9 30594

查看目前进程

# 显示现行终端机下的所有程序,包括其他用户的程序。
ps -a 
# 显示所有程序
ps -A 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant