linuxÉó²éÀú³ÌÊÇÄĸö³ÌÐòµÄ
¿ÉÒÔͨ¹ýʹÓà ps¡¢top ºÍ pstree ÏÂÁîÉó²é linux Àú³ÌËùÊôµÄ³ÌÐò¡£ÏêϸҪÁì»®·ÖΪ£ºÊ¹Óà ps ÏÂÁîÉó²éÀú³Ì id¡¢ÏÂÁîÐвÎÊýºÍÏÂÁîÃû³Æ£¬ÆäÖÐÏÂÁîÃû³Æ¼´ÎªËùÊô³ÌÐò¡£Ê¹Óà top ÏÂÁî½øÈëËÑË÷ģʽºóÊäÈëÀú³ÌÃû³Æ²éÕÒ£¬Ñ¡ÖÐºó°´ h ¼üÉó²é “command” Ò»À¸ÏÔʾµÄËùÊô³ÌÐò¡£Ê¹Óà pstree ÏÂÁîÌìÉúÀú³ÌÊ÷Ðνṹ£¬ÆäÖÐÀú³ÌµÄÏÂÁîÃû³ÆÏÔʾÔÚÀ¨ºÅÄÚ¡£
ÔõÑùÉó²é Linux Àú³ÌËùÊôµÄ³ÌÐò
ÔÚ Linux ϵͳÖУ¬Éó²éÀú³ÌËùÊôµÄ³ÌÐòÓÐÒÔϳ£ÓÃÒªÁ죺
1. ʹÓà ps ÏÂÁî
ps ÏÂÁîµÄ»ù±¾Ó﷨Ϊ£º
ps -F
µÇ¼ºó¸´ÖÆ
ÆäÖРΪÊäÌØÊâʽѡÏ³£ÓõÄÑ¡ÏîÓУº
%a£ºÏÔʾËùÓÐÀú³ÌÐÅÏ¢
%p£ºÏÔʾÀú³Ì ID
%c£ºÏÔʾÀú³ÌÆô¶¯ÏÂÁî
ÒªÉó²éÀú³ÌËùÊôµÄ³ÌÐò£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ
ps -eo pid,args,comm | grep
µÇ¼ºó¸´ÖÆ
ÀýÈ磬Ҫ²éÕÒÃûΪ “firefox” µÄÀú³Ì£¬Ö´ÐÐÒÔÏÂÏÂÁ
ps -eo pid,args,comm | grep firefox
µÇ¼ºó¸´ÖÆ
Êä³öЧ¹û½«ÏÔʾÀú³Ì ID¡¢ÏÂÁîÐвÎÊýºÍÏÂÁîÃû³Æ£¬ÆäÖÐÏÂÁîÃû³Æ¼´ÎªÀú³ÌËùÊôµÄ³ÌÐò¡£
2. ʹÓà top ÏÂÁî
top ÏÂÁîÒÔ½»»¥Ê½·½·¨ÏÔʾʵʱÀú³ÌÐÅÏ¢¡£ÒªÉó²éÀú³ÌËùÊôµÄ³ÌÐò£¬Ö´ÐÐÒÔÏÂÏÂÁ
top -c -b
µÇ¼ºó¸´ÖÆ
ÔÚ top ½çÃæÖУ¬°´ F ¼ü½øÈëËÑË÷ģʽ£¬È»ºóÊäÈëÀú³ÌÃû³Æ¼´¿É²éÕÒ¶ÔÓ¦Àú³Ì¡£Ñ¡ÖÐÄ¿µÄÀú³Ìºó£¬°´ h ¼üÉó²éÏà¹ØÐÅÏ¢£¬ÆäÖÐ “COMMAND” Ò»À¸ÏÔʾÀú³ÌËùÊôµÄ³ÌÐò¡£
3. ʹÓà pstree ÏÂÁî
pstree ÏÂÁî¿ÉÒÔÌìÉúÀú³ÌÊ÷Ðνṹ£¬ÏÔʾÿ¸öÀú³Ì¼°Æä×ÓÀú³ÌµÄ¹Øϵ¡£ÒªÉó²éÀú³ÌËùÊôµÄ³ÌÐò£¬Ö´ÐÐÒÔÏÂÏÂÁ
pstree -p
µÇ¼ºó¸´ÖÆ
ÔÚÊä³öµÄÊ÷ÐνṹÖУ¬Ã¿¸öÀú³ÌµÄÏÂÁîÃû³Æ¶¼»áÏÔʾÔÚÀ¨ºÅÄÚ¡£
ÒÔÉϾÍÊÇlinuxÉó²éÀú³ÌÊÇÄĸö³ÌÐòµÄµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡