I
I
issssrt2019-07-16 19:51:26
linux
issssrt, 2019-07-16 19:51:26

How to kill a process with parameters (arguments)?

Many processes are running, for example:

script.py arg1
script.py arg2
script.py arg3

How to kill a process that was started as script.py arg3 ?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DevMan, 2019-07-16
@issssrt

ps aux | grep 'script.py arg3'get pid and kill.
you can think for yourself how to combine it into a one-liner.

K
ky0, 2019-07-17
@ky0

The correct way is to provide a method inside the script to save the PID in the form of, for example, writing it to a temporary file with a known name.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question