Linux - How to get process name from pid, Find the process name using process id

How to get process name from pid

How can I find the process name from the process id?

You can find the process name or the command used by the process-id or pid from
/proc/pid/cmdline

For exmaple:

 # ps aux
 
   ................
   ................
   user  2480  0.0  1.2 119100 12728 pts/0  Sl   22:42   0:01 gnome-terminal
   ................
   ................

To find the process name used by pid 2480 you use can

   # cat /proc/2480/cmdline 

     gnome-terminal

It is the simplest way to find the process name using process id or pid.

The topic on Linux - How to get process name from pid is posted by - Math

Hope you have enjoyed, Linux - How to get process name from pidThanks for your time

Tech Bluff