jupyter notebook 后台运行

入门级: jupyter notebook --allow-root > jupyter.log 2>&1 &

进阶版: nohup jupyter notebook --allow-root > jupyter.log 2>&1 &

解释: 1. 用&让命令后台运行, 并把标准输出写入jupyter.log中

nohup表示no hang up, 就是不挂起, 于是这个命令执行后即使终端退出, 也不会停止运行.
2. 终止进程

执行上面第2条命令, 可以发现关闭终端重新打开后, 用jobs找不到jupyter这个进程了, 于是要用ps -a, 可以显示这个进程的pid.
kill -9 pid 终止进程

猜你喜欢

转载自www.cnblogs.com/laowangxieboke/p/12515244.html