ubuntu后台执行脚本

nohup python3 cf_threads.py &

ps aux | grep cf_threads.py 使用ps命令与grep一起来搜索脚本名,以确认它是否正在运行:

root@monica:~/chao_code/cf# ps aux | grep cf_threads.py
root     2749473 96.5  1.4  36564 29504 pts/1    R    20:41   0:49 python3 cf_threads.py
root     2749569  0.0  0.0   6436   660 pts/1    S+   20:42   0:00 grep --color=auto cf_threads.py 
posted @ 2024-02-04 20:37  __username  阅读(14)  评论(0)    收藏  举报