linuxÉó²éЧÀÍÀú³ÌÏÂÁî
linux ϵͳÖÐÉó²éÕýÔÚÔËÐеÄЧÀÍÀú³ÌµÄÒªÁì°üÀ¨£º1. ʹÓà ps -ef ÏÂÁîÉó²éËùÓÐÕýÔÚÔËÐеÄÀú³Ì£»2. ʹÓà systemctl list-units –type=service –state=running ÏÂÁîÉó²éËùÓÐÕýÔÚÔËÐеÄЧÀÍ£»3. ʹÓà service status ÏÂÁîÉó²éÌض¨Ð§À͵Ä״̬£»4. ʹÓà netstat -anp | grep ÏÂÁîÉó²éÌض¨Ð§ÀÍʹÓõÄÅþÁ¬£»5. ʹÓà top –
Linux Éó²éЧÀÍÀú³ÌÏÂÁî
ÎÊÌ⣺ÔõÑùÉó²é Linux ϵͳÖÐÕýÔÚÔËÐеÄЧÀÍÀú³Ì£¿
Ïêϸ»Ø¸²£º
1. ps ÏÂÁî
ps ÏÂÁîÊÇ Linux ÖÐ×î»ù±¾µÄÀú³Ì¼àÊÓÏÂÁî¡£ÒªÉó²éËùÓÐÕýÔÚÔËÐеÄÀú³Ì£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ
ps -ef
µÇ¼ºó¸´ÖÆ
´ËÏÂÁÊä³öËùÓÐÕýÔÚÔËÐÐÀú³ÌµÄÏêϸÁÐ±í£¬°üÀ¨ÆäÀú³Ì ID (PID)¡¢Óû§Ãû¡¢Æô¶¯Ê±¼äµÈÐÅÏ¢¡£
2. systemctl ÏÂÁî
systemctl ÏÂÁîÊÇÖÎÀí systemd ЧÀ͵Ť¾ß¡£ÒªÉó²éËùÓÐÕýÔÚÔËÐеÄЧÀÍ£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ
systemctl list-units --type=service --state=running
µÇ¼ºó¸´ÖÆ
´ËÏÂÁÊä³öËùÓÐÕýÔÚÔËÐеÄЧÀ͵ÄÁÐ±í£¬°üÀ¨ÆäÃû³Æ¡¢×´Ì¬ºÍÐÎò¡£
3. service ÏÂÁî
service ÏÂÁîÒ²¿ÉÒÔÓÃÀ´Éó²éЧÀ͵ÄÔËÐÐ״̬¡£ÒªÉó²éÌض¨Ð§À͵Ä״̬£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ
service <service_name> status</service_name>
µÇ¼ºó¸´ÖÆ
ÀýÈ磬ҪÉó²é Apache Web ЧÀÍÆ÷µÄ״̬£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ
service apache2 status
µÇ¼ºó¸´ÖÆ
4. netstat ÏÂÁî
netstat ÏÂÁî¿ÉÒÔÓÃÀ´Éó²éϵͳÉϵÄÍøÂçÅþÁ¬¡£ÒªÉó²éÓÉÌض¨Ð§ÀÍʹÓõÄÅþÁ¬£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ
netstat -anp | grep <port_number></port_number>
µÇ¼ºó¸´ÖÆ
ÀýÈ磬ҪÉó²éÓÉ Apache Web ЧÀÍÆ÷ʹÓõÄÅþÁ¬£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ
netstat -anp | grep 80
µÇ¼ºó¸´ÖÆ
5. top ÏÂÁî
top ÏÂÁî¿ÉÒÔʵʱÏÔʾϵͳÖÐÕýÔÚÔËÐеÄÀú³Ì¡£ÒªÉó²éÕýÔÚʹÓÃ×î¶à×ÊÔ´µÄЧÀÍÀú³Ì£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ
top -c
µÇ¼ºó¸´ÖÆ
´ËÏÂÁÏÔʾһ¸ö½»»¥Ê½½çÃ棬ÆäÖÐÁгöÁËÕýÔÚʹÓÃ×î¶à CPU ºÍÄÚ´æµÄÀú³Ì¡£
ÒÔÉϾÍÊÇlinuxÉó²éЧÀÍÀú³ÌÏÂÁîµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡