5

top is showing that some python script is using all computer resources

Sadly, I have more that one python scrip being running. How can I identify which file it is being run from?

I obtained PID using top command

1
  • 1
    top -c will show the full command line, though you may need to make your terminal wider. Pressing c when in interactive mode will toggle showing the full command line. Feb 10, 2022 at 19:01

1 Answer 1

4

You can try reading the file named cmdline in the directory /proc/<PID>/. It is a null-joined list of the program and its arguments. Here is an example on my ubuntu for the process handling unattended-upgrades:

$ cat /proc/133319/cmdline | xargs -0 echo
/usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal

Would that help you with your problem?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .