lzp1103

1.nohup

用途:不挂断地运行命令。

语法:nohup Command [ Arg … ] [ & ]

  无论是否将 nohup 命令的输出重定向到终端,输出都将附加到当前目录的 nohup.out 文件中。

  如果当前目录的 nohup.out 文件不可写,输出重定向到 $HOME/nohup.out 文件中。

  如果没有文件能创建或打开以用于追加,那么 Command 参数指定的命令不可调用。

退出状态:该命令返回下列出口值:   
  126 可以查找但不能调用 Command 参数指定的命令。   
  127 nohup 命令发生错误或不能查找由 Command 参数指定的命令。   
  否则,nohup 命令的退出状态是 Command 参数指定命令的退出状态。

2.&

用途:在后台运行

一般两个一起用

nohup command &

eg:

1
nohup /usr/local/node/bin/node /www/im/chat.js >> /usr/local/node/output.log 2>&1 &

进程号7585

查看使用某端口的进程

1
lsof -i:8090

1
netstat -ap|grep 8090

查看到进程id之后,使用netstat命令查看其占用的端口

1
netstat -nap|grep 7779

使用kill杀掉进城后再启动

分类:

技术点:

相关文章:

  • 2021-08-24
  • 2021-09-12
  • 2021-06-02
  • 2021-10-07
  • 2022-12-23
  • 2021-09-12
猜你喜欢
  • 2021-10-07
  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
相关资源
相似解决方案