Linux PSÏÂÁîÉî¶ÈÆÊÎö
ÎÊÌ⣺ÉîÈëÏàʶLinux PSÏÂÁÐèÒªÏêϸ´úÂëʾÀý
ÔÚLinux²Ù×÷ϵͳÖУ¬PS£¨Process Status£©ÏÂÁîÊÇÒ»¸öÓÃÓÚÉó²éÄ¿½ñϵͳÀú³Ì״̬µÄ³£ÓÃÏÂÁͨ¹ýPSÏÂÁÎÒÃÇ¿ÉÒÔÉó²éϵͳÖÐÔËÐеÄÀú³ÌÐÅÏ¢£¬°üÀ¨Àú³ÌµÄPID¡¢Õ¼ÓõÄ×ÊÔ´ÇéÐΡ¢ÔËÐÐʱ¼äµÈ¡£±¾ÎĽ«ÉîÈëÏÈÈÝPSÏÂÁîµÄÓ÷¨£¬²¢Í¨¹ýÏêϸµÄ´úÂëʾÀýÀ´ÑÝʾÆ书Ч¡£
Ò»¡¢PSÏÂÁîµÄ»ù±¾Ó÷¨
PSÏÂÁîµÄ»ù±¾Ó÷¨ÈçÏ£º
Éó²éÄ¿½ñϵͳËùÓÐÀú³ÌµÄÏêϸÐÅÏ¢£º
ps -ef
µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ
½öÏÔʾĿ½ñÓû§µÄÀú³ÌÐÅÏ¢£º
ps u
µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ
Éó²éÖ¸¶¨Àú³ÌµÄÏêϸÐÅÏ¢£º
ps -p <PID>
µÇ¼ºó¸´ÖÆ
ÆäÖУ¬ ΪÀú³ÌµÄPIDºÅ¡£
¶þ¡¢PSÏÂÁî³£ÓÃÑ¡Ïî
-e£ºÏÔʾϵͳÖÐËùÓÐÀú³Ì£¬°üÀ¨ÆäËûÓû§µÄÀú³Ì¡£
-f£ºÏÔʾÍêÕûµÄÀú³ÌÐÅÏ¢£¬°üÀ¨Àú³ÌµÄUID¡¢PID¡¢PPIDµÈ¡£
-u£ºÏÔʾÀú³ÌµÄÏêϸÐÅÏ¢£¬°üÀ¨CPUÕ¼ÓÃÂÊ¡¢ÄÚ´æÕ¼ÓÃÂʵȡ£
-p£ºÏÔʾָ¶¨PIDµÄÀú³ÌÐÅÏ¢¡£
Èý¡¢PSÏÂÁîµÄʵÀýÑÝʾ
Éó²éϵͳÖÐËùÓÐÀú³ÌµÄÏêϸÐÅÏ¢£º
ps -ef
µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ
ÔËÐÐÒÔÉÏÏÂÁ½«ÏÔʾϵͳÖÐËùÓÐÀú³ÌµÄÏêϸÐÅÏ¢¡£Ã¿Ò»Ðдú±íÒ»¸öÀú³Ì£¬°üÀ¨UID¡¢PID¡¢PPID¡¢CPUÕ¼ÓÃÂÊ¡¢ÄÚ´æÕ¼ÓÃÂʵÈÐÅÏ¢¡£
½öÏÔʾĿ½ñÓû§µÄÀú³ÌÐÅÏ¢£º
ps u
µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ
¸ÃÏÂÁÏÔʾĿ½ñÓû§µÄËùÓÐÀú³ÌÐÅÏ¢£¬°üÀ¨ÏÂÁî¡¢CPUÕ¼ÓÃÂÊ¡¢ÄÚ´æÕ¼ÓÃÂʵȡ£
Éó²éÖ¸¶¨Àú³ÌµÄÏêϸÐÅÏ¢£º
ps -p 1234
µÇ¼ºó¸´ÖÆ
ÒÔÉÏÏÂÁÏÔʾPIDΪ1234µÄÀú³ÌÏêϸÐÅÏ¢£¬°üÀ¨ÏÂÁî¡¢CPUÕ¼ÓÃÂÊ¡¢ÄÚ´æÕ¼ÓÃÂʵȡ£
ͨ¹ýÒÔÉÏʾÀý£¬ÎÒÃÇ¿ÉÒÔ¸üÉîÈëµØÏàʶLinux PSÏÂÁîµÄÓ÷¨ºÍ¹¦Ð§£¬´Ó¶ø¸üºÃµØÖÎÀíϵͳÖеÄÀú³Ì¡£Ï£Íû±¾ÎĶÔÄúÓÐËù×ÊÖú¡£
ÒÔÉϾÍÊÇLinux PSÏÂÁîÉî¶ÈÆÊÎöµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡