1

I have a .py file running in the background, invoked with:

python file.py &

Now I try to stop it as using:

$ ps -fA | grep python
root     31032     1  0 14:41 ?        00:00:00 python home/file.py
$ kill -9 1

This does not work. I thought kill -9 was a sure fire way to shut down a process using its pid, but it seems weird that the pid for the .py file is 1 in the first place.

How do i stop this file?

muru
  • 197,895
  • 55
  • 485
  • 740

1 Answers1

3

The PID is 31032, the next number (1) is the PPID (Parent Process ID).

You want to kill the PID of 31032.

If you want to see the headers which show what each column means, run ps without the grep command, and the first line printed will be a description of the column.

Delorean
  • 10,923