½â¶Á Linux PS ÏÂÁîµÄ¹¦Ð§
Linux²Ù×÷ϵͳÊÇÒ»ÖÖ³£ÓõIJÙ×÷ϵͳ£¬ÆÕ±éÓ¦ÓÃÓÚЧÀÍÆ÷ºÍСÎÒ˽È˵çÄÔÖС£ÔÚLinuxϵͳÖУ¬ÓÐÐí¶àÏÂÁî¿ÉÓÃÓÚÖÎÀíϵͳ״̬ºÍ¼à¿ØÀú³Ì£¬ÆäÖÐÖ®Ò»¼´ÊÇPSÏÂÁî¡£PSÏÂÁîÊÇÒ»ÖÖºÜÊÇÇ¿Ê¢µÄÏÂÁ¿ÉÒÔÓÃÀ´Éó²éϵͳÖÐÕýÔÚÔËÐеÄÀú³Ì»ò³ÌÐòµÄÏêϸÐÅÏ¢£¬°üÀ¨Àú³ÌID¡¢CPUʹÓÃÂÊ¡¢ÄÚ´æÕ¼ÓÃÇéÐεȡ£±¾ÎĽ«ÆÊÎöPSÏÂÁîµÄÓÃ;£¬²¢ÌṩһЩÏêϸµÄ´úÂëʾÀý¡£
1. PSÏÂÁîµÄ»ù±¾Ó÷¨
PSÏÂÁîµÄ»ù±¾Óï·¨ÈçÏ£º
ps [options]
µÇ¼ºó¸´ÖÆ
PSÏÂÁîÊÇÒ»¸ö²»´øÈκβÎÊýµÄ¼òÆÓÏÂÁÆäĬÈÏÐÐΪÊÇÁгöÄ¿½ñµÇÈÎÃü»§µÄËùÓÐÀú³Ì¡£¿ÉÒÔͨ¹ýÌí¼Ó²î±ðµÄÑ¡ÏîÀ´ÐÞ¸ÄPSÏÂÁîµÄÐÐΪ£¬ÏÂÃ潫ÏÈÈÝһЩ³£ÓõÄÑ¡Ïî¼°ÆäÓÃ;¡£
2. PSÏÂÁî³£ÓÃÑ¡Ïî
-e£ºÁгöϵͳÖÐËùÓеÄÀú³Ì¡£
-f£ºÏÔʾÍêÕûµÄÀú³ÌÐÅÏ¢¡£
-l£ºÒÔ³¤ÃûÌÃÏÔʾÀú³ÌÐÅÏ¢¡£
-h£º²»ÏÔʾÎÊÌâÐС£
-u£ºÏÔʾÀú³ÌÊôÖ÷µÄÓû§Ãû³ÆºÍÆäËûÏêϸÐÅÏ¢¡£
3. PSÏÂÁîʾÀý
3.1 ÁгöϵͳÖÐËùÓеÄÀú³Ì
ps -e
µÇ¼ºó¸´ÖÆ
Õâ¸öÏÂÁÁгöϵͳÖÐËùÓеÄÀú³Ì£¬°üÀ¨ÆäËûÓû§µÄÀú³Ì¡£
3.2 ÏÔʾÍêÕûµÄÀú³ÌÐÅÏ¢
ps -f
µÇ¼ºó¸´ÖÆ
Õâ¸öÏÂÁÏÔʾÍêÕûµÄÀú³ÌÐÅÏ¢£¬°üÀ¨Àú³ÌID¡¢¸¸Àú³ÌID¡¢CPUʹÓÃÂÊ¡¢ÄÚ´æÕ¼ÓõÈÏêϸÐÅÏ¢¡£
3.3 ÒÔ³¤ÃûÌÃÏÔʾÀú³ÌÐÅÏ¢
ps -l
µÇ¼ºó¸´ÖÆ
Õâ¸öÏÂÁÒÔ³¤ÃûÌÃÏÔʾÀú³ÌÐÅÏ¢£¬°üÀ¨Àú³ÌµÄÏêϸÐÅÏ¢ÒÔ¼°×´Ì¬µÈ¡£
3.4 ÏÔʾָ¶¨Óû§µÄÀú³ÌÐÅÏ¢
ps -u username
µÇ¼ºó¸´ÖÆ
Õâ¸öÏÂÁÏÔʾָ¶¨Óû§µÄËùÓÐÀú³ÌÐÅÏ¢£¬¿ÉÒÔͨ¹ýÌæ»»usernameΪÏêϸÓû§ÃûÀ´Éó²é¸ÃÓû§µÄÀú³Ì¡£
4. ½áÓï
PSÏÂÁîÊÇLinuxϵͳÖкÜÊÇÊÊÓõÄÀú³ÌÖÎÀí¹¤¾ß£¬¿ÉÒÔ×ÊÖúÓû§¼à¿Øϵͳ״̬ºÍÖÎÀíÀú³Ì¡£Í¨¹ý±¾ÎĵÄÏÈÈÝ£¬¶ÁÕß¿ÉÒÔÔ½·¢ÊìϤPSÏÂÁîµÄ»ù±¾Ó÷¨ºÍ³£ÓÃÑ¡Ï²¢Äܹ»Í¨¹ýÏêϸµÄ´úÂëʾÀýÀ´¼ÓÉîÃ÷È·¡£Ï£Íû±¾ÎĶԶÁÕßÓÐËù×ÊÖú£¡
ÒÔÉϾÍÊǽâ¶Á Linux PS ÏÂÁîµÄ¹¦Ð§µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡