nohup命令使用
最近需要在服务器上跑模型,需要长时间运行,但是服务器是通过 ssh
连接的,如果我们中途断开连接,正在跑的代码也会自动关闭。实在是有点整蛊,要想
ssh 断开连接后代码还可以继续执行,需要使用 nohup 命令。
使用 nohup --help,我们可以得到帮助信息
1 | (base) ➜ ~ nohup --help |
其中第三行解释了 nohup 命令的作用
Run COMMAND, ignoring hangup signals.
从描述中我们可以看到,其作用其实很简单,就是忽略 hup
信号。那么现在问题来了,hup 信号是什么?有什么作用?



