ดูรายละเอียด process บน Linux


159down voteaccepted
On all POSIX-compliant systems, and with Linux, you can use ps:
ps -p 1337 -o comm=
Here, the process is selected by its PID with -p. The -o option specifies the output format, commmeaning the command name.


You can find the process name or the command used by the process-id or pid from
/proc/pid/cmdline
by doing
cat /proc/pid/cmdline
Here pid is the pid for which you want to find the name
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

Comments

Popular posts from this blog

โดนเอาเลขบัตรเครติดไปใช้ออนไลน์

แนะนำเว็บไซต์ Thaiwaterpump.com