How to kill a running python in shell script when we know the python file name xxx.py
?
(it is executed by cmd python xxx.py
)
I can use ps aux | grep python
to get the pid of it. and then
kill pid
to terminate it.
but every time, I have to execute two cmd. Is there a good way to do it?