Finding the command for a specific PID in Linux from Python

后端 未结 7 855
半阙折子戏
半阙折子戏 2020-12-19 05:33

I\'d like to know if it\'s possible to find out the \"command\" that a PID is set to. When I say command, I mean what you see in the last column when you run the command \"t

相关标签:
7条回答
  • 2020-12-19 06:34

    Read up on the ps command and parse its output.

    ps -p [PID] -o cmd 
    

    should do it

    0 讨论(0)
提交回复
热议问题