linuxÉó²éÀú³ÌÔËÐÐʱ³¤
linux ÖÐÉó²éÀú³ÌÔËÐÐʱ³¤¿ÉʹÓÃÏÂÁps aux | grep -v grep | awk ‘{print $2, $10, $8, $9}’£¬ÆäÌṩÁËÒÔÏÂÐÅÏ¢£º1. pid£¨Àú³Ì id£©£»2. stime£¨Àú³ÌÆô¶¯Ê±¼ä£©£»3. %cpu£¨Ä¿½ñ cpu ʹÓÃÂÊ£©£»4. %mem£¨Ä¿½ñÄÚ´æʹÓÃÂÊ£©¡£
Linux Éó²éÀú³ÌÔËÐÐʱ³¤
ÒªÉó²é Linux ÖÐÀú³ÌÔËÐеÄʱ³¤£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ
ps aux | grep -v grep | awk ‘{print $2, $10, $8, $9}’
´ËÏÂÁîÌṩÁËÒÔÏÂÐÅÏ¢£º
PID (×ֶΠ2)£ºÀú³ÌµÄÀú³Ì ID
STIME (×ֶΠ10)£ºÀú³ÌÆô¶¯µÄʱ¼ä£¬ÃûÌÃΪ “HH:MM:SS”
%CPU (×ֶΠ8)£ºÀú³ÌÄ¿½ñʹÓÃµÄ CPU °Ù·Ö±È
%MEM (×ֶΠ9)£ºÀú³ÌÄ¿½ñʹÓõÄÄÚ´æ°Ù·Ö±È
ʾÀýÊä³ö£º
12345 14:30:00 2.5 5.0 23456 15:15:00 1.0 2.0 34567 16:00:00 3.0 6.0
µÇ¼ºó¸´ÖÆ
´ÓÉÏÀýÖУ¬¿ÉÒÔ¿´³ö£º
PID Ϊ 12345 µÄÀú³Ì×Ô 14:30:00 ×îÏÈÔËÐУ¬Ä¿½ñʹÓà 2.5% µÄ CPU ºÍ 5.0% µÄÄÚ´æ¡£
PID Ϊ 23456 µÄÀú³Ì×Ô 15:15:00 ×îÏÈÔËÐУ¬Ä¿½ñʹÓà 1.0% µÄ CPU ºÍ 2.0% µÄÄÚ´æ¡£
PID Ϊ 34567 µÄÀú³Ì×Ô 16:00:00 ×îÏÈÔËÐУ¬Ä¿½ñʹÓà 3.0% µÄ CPU ºÍ 6.0% µÄÄÚ´æ¡£
ÒÔÉϾÍÊÇlinuxÉó²éÀú³ÌÔËÐÐʱ³¤µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡