Il doit y avoir un meilleur moyen.
C'est la commande que vous voulez tuer
$ ps aux
root     163622  0.0  0.3 229392 28852 ?        S     2019   0:00 /usr/bin/python3.5 imap.py
Vous pouvez extraire le processus avec des arguments avec pgrep -a
$ pgrep -a python3.5 
125033 /usr/bin/python3.5 var.py        <----Non pertinent python3.Je veux exclure 5
125034 /usr/bin/python3.5 imap.py
125035 /usr/bin/python3.5 foo.py
Seuls ceux qui ont frappé l'argument avec grep
$ pgrep -a python3.5 | grep imap.py
125034 /usr/bin/python3.5 imap.py
Faites-le pid seulement
$ pgrep -a python3.5 | grep imap.py | awk '{print $1}'
125034
...
Tuez tout ensemble
kill $(pgrep -a python3.5 | grep imap.py | awk '{print $1}')
Il doit y avoir un meilleur moyen.