Image by Pezibear from Pixabay

如果ctrl + c沒法終止怎麼辦?

Yuan Ko
Mess up
Published in
4 min readNov 25, 2019

--

利用kill -9 pid
pid要利用
ps aux | gerp “relate word”
relate word表示你輸入的指令,有用到哪個字,現在要抓到相關的字詞
才能找到pid
更多grep的資料
grep python 就是抓python以前輸的指令有包含python的,darknet就是抓有darknet的

root@forge-498v8qc7-75d948ffdb-2pcs9:~# ps aux | grep python
root 21 0.0 0.0 609828 70520 ? Sl Nov16 2:58 /opt/conda/bin/python3.6 /opt/conda/bin/jupyter-lab --ip=0.0.0.0 --allow-root --NotebookApp.allow_origin=* --NotebookApp.allow_remote_access=True --NotebookApp.token= --NotebookApp.notebook_dir=/root/notebooks --NotebookApp.cookie_secret_file=/root/cookie.secret --NotebookApp.base_url='lab/498v8qc7'
root 22 0.0 0.0 4209572 266080 ? Sl Nov16 2:57 /opt/conda/bin/python /opt/conda/bin/tensorboard --path_prefix=/tensor/498v8qc7 --logdir /root/notebooks/tensorflow/logs
root 12038 0.0 0.3 12221116 1856492 ? Ssl Nov16 2:30 /opt/conda/bin/python -m ipykernel_launcher -f /root/notebooks/.local/share/jupyter/runtime/kernel-84600a83-7362-4d00-a641-cc0938cd4b9c.json
root 12997 0.0 0.0 26680 11392 ? S Nov16 0:00 /opt/conda/bin/python -c from multiprocessing.semaphore_tracker import main;main(54)
root 27673 0.0 0.0 13036 1080 pts/2 S+ 08:32 0:00 grep python
#--------------------------------------------------root@forge-498v8qc7-75d948ffdb-2pcs9:~# ps aux | grep darknet
root 28652 0.0 0.0 13036 1084 pts/2 S+ 08:33 0:00 grep darknet
root 56579 187 1.0 24114080 5794908 pts/1 Rl+ 07:58 65:23 ./darknet detector train cfg/voc.data cfg/yolov3-voc.cfg darknet19_448.conv.23 -gpu
root@forge-498v8qc7-75d948ffdb-2pcs9:~#

root後面那個數字就是pid

a u x 分別是ps的三種功能
a 表示 所有的使用者的process
u 表示 以用戶為主的格式顯示程序狀態(這我也不明白)
x 表示 顯示所有程序,不用terminal來區分
參考:https://blog.csdn.net/hanner_cheung/article/details/6081440

--

--