If I have the PID number for a process (on a UNIX machine), how can I find out the name of its associated process?
What do I have to do?
linuxpidprocessshellunix
If I have the PID number for a process (on a UNIX machine), how can I find out the name of its associated process?
What do I have to do?
Best Answer
On all POSIX-compliant systems, and with Linux, you can use
ps
:Here, the process is selected by its PID with
-p
. The-o
option specifies the output format,comm
meaning the command name.For the full command, not just the name of the program, use:
See also:
ps
– The Open Group Base Specifications Issue 6