linuxÖÐpsºÍpidÓÐʲô·×ÆçÑù
linuxÖÐpsºÍpid·×ÆçÑùµÄµãÔÚÓÚ£º1¡¢psÊÇÒ»¸öÓÃÓÚÉó²éÄ¿½ñϵͳÖÐÔËÐÐÀú³ÌµÄÏÂÁ¶øpidÌåÏÖÀú³ÌµÄΨһ±êʶ·û£»2¡¢Ê¹ÓÃpsÏÂÁîÓÃÀ´»ñÈ¡Àú³ÌµÄÏêϸÐÅÏ¢£¬Ê¹ÓÃpidÀ´Çø·ÖºÍÖÎÀí²î±ðµÄÀú³Ì¡£
±¾½Ì³Ì²Ù×÷ϵͳ£ºLinux5.18.14ϵͳ¡¢Dell G3µçÄÔ¡£
ÔÚ Linux ÖУ¬psÊÇÒ»¸öÓÃÓÚÉó²éÄ¿½ñϵͳÖÐÔËÐÐÀú³ÌµÄÏÂÁ¶øpidÌåÏÖÀú³ÌµÄΨһ±êʶ·û¡£
ÏêϸÀ´Ëµ£¬ËüÃǵIJî±ðÈçÏ£º
ps£ºÌåÏÖ “Process Status”£¬ÊÇÒ»¸öÓÃÓÚÉó²éÄ¿½ñϵͳÖÐÔËÐÐÀú³Ì״̬µÄÏÂÁî¡£Ëü¿ÉÒÔÁгöϵͳÖеÄÀú³Ì£¬²¢ÌṩÓйØÀú³ÌµÄÏêϸÐÅÏ¢£¬ÈçÀú³ÌID£¨PID£©¡¢¸¸Àú³ÌID£¨PPID£©¡¢CPU ʹÓÃÂÊ¡¢ÄÚ´æÕ¼Óõȡ£
pid£ºÌåÏÖÀú³ÌID£¬ÊÇÒ»¸öÓÉϵͳ·ÖÅɸøÿ¸öÕýÔÚÔËÐеÄÀú³ÌµÄΨһ±êʶ·û¡£Ã¿¸öÀú³Ì¶¼ÓÐÒ»¸öΨһµÄPID£¬Ëü¿ÉÒÔÓÃ×÷±êʶºÍÖÎÀíÀú³ÌµÄÒÀ¾Ý¡£PID ÊÇÒ»¸ö·Ç¸ºÕûÊý£¬²¢ÇÒÔÚϵͳ¹æÄ£ÄÚÊÇΨһµÄ¡£
×ܽáÀ´Ëµ£¬psÊÇÒ»¸öÓÃÓÚÉó²éÀú³Ì״̬µÄÏÂÁ¶øpidÊÇ´ú±íÀú³ÌµÄΨһ±êʶ·û¡£Äã¿ÉÒÔʹÓÃpsÏÂÁîÀ´»ñÈ¡Àú³ÌµÄÏêϸÐÅÏ¢£¬²¢Ê¹ÓÃpidÀ´Çø·ÖºÍÖÎÀí²î±ðµÄÀú³Ì¡£
ÒÔÉϾÍÊÇlinuxÖÐpsºÍpidÓÐʲô·×ÆçÑùµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡