将项目置于后台运行
node index.js &
如果想要查看项目端口是否存在,即查看项目是否在后台运行
netstat -tpln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:10080 0.0.0.0:* LISTEN 7853/vsftpd
tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 8196/mongod
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN 8426/redis-server 1
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 30787/nginx: master
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1178/sshd
tcp6 0 0 :::9092 :::* LISTEN 30938/node
结束对应的进程,kill后面写的是进程号.
kill 30938