4

If I have the PID number for a process (on a UNIX machine), how can I know the name of its associated process? What do I have to do?

dawud
  • 15,096
  • 3
  • 42
  • 61
AndreaNobili
  • 197
  • 2
  • 5

3 Answers3

7

Did you try either:

ps -p <PID> -o cmd

or if you only want the command name

ps -p <PID> -o comm

Or try this one (tested on Ubuntu):

cat /proc/<PID>/cmdline
Petter H
  • 3,443
  • 1
  • 16
  • 19
3

Try ps -eo pid,command PIDNUMBER

Janne Pikkarainen
  • 31,852
  • 4
  • 58
  • 81
1

try top in terminal it will give you all details of PID and Process name