This question has already been answered:

I started it with the following command: nohup python3 /home/python_ml/BotMainPart.py How can I stop the execution of this process?

Reported as a duplicate by aleksandr barakin linux Nov 30 '18 at 12:37 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

  • according to the classics - kiln. recognize its pid and send it to kill <pid> , you may need to send the "correct signal" - then kill -9 <pid> , but the process should be able to correctly process this signal. - KoVadim
  • and how to know his pid? - Ivan Anatoevich
  • in the process list. - aleksandr barakin
  • You can find the list of processes in top / htop / atop, also by running pgrep python3 or ps aux | grep python3 ps aux | grep python3 and then with eyes to find the desired process. - KoVadim
  • Usually, programmers in their code save their pid special file (for example in / var / run or / tmp) and the task to nail down the process becomes trivial. - KoVadim

1 answer 1

To solve the problem I used: killall python3

  • one
    Not the best idea. This will kill all processes running python3. Something like this is better: kill $ (ps aux | grep BotMainPart.py | awk '{print $ 2}') - nick_gabpe