×ðÁú¿­Ê±¹ÙÍøµÇ¼

linuxÔõÑùÉó²é¾ç±¾Àú³ÌÊÇ·ñ±£´æ

linuxÉó²é¾ç±¾Àú³ÌÊÇ·ñ±£´æµÄÒªÁìÓУº1¡¢Ê¹ÓÃpsÏÂÁÁгöÄ¿½ñÔËÐеÄÀú³Ì£¬Í¨¹ýgrepÏÂÁî¹ýÂ˳öÓë½ÅÄÚÇé¹ØµÄÀú³Ì£¬²¢¼ì²éÊÇ·ñ±£´æ£»2¡¢Ê¹ÓÃpgrepÏÂÁͨ¹ýÀú³ÌµÄÃû³Æ²éÕÒÆäÀú³Ìid£»3¡¢Ê¹ÓÃpidofÏÂÁͨ¹ýÀú³ÌµÄÃû³ÆÖ±½Ó²éÕÒÀú³Ìid¡£

±¾½Ì³Ì²Ù×÷ϵͳ£ºLinux5.18.14ϵͳ¡¢Dell G3µçÄÔ¡£

ÔÚLinuxÖУ¬¿ÉÒÔʹÓöàÖÖÒªÁìÀ´Éó²é¾ç±¾Àú³ÌÊÇ·ñ±£´æ¡£ÒÔÏÂÊǼ¸ÖÖ³£¼ûµÄÒªÁ죺

1¡¢Ê¹ÓÃpsÏÂÁpsÏÂÁî¿ÉÒÔÁгöÄ¿½ñÔËÐеÄÀú³Ì¡£Äã¿ÉÒÔͨ¹ýgrepÏÂÁî¹ýÂ˳öÓë½ÅÄÚÇé¹ØµÄÀú³Ì£¬²¢¼ì²éÊÇ·ñ±£´æ¡£ÀýÈ磬¼ÙÉè¾ç±¾ÃûΪscript.sh£¬Äã¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÀ´¼ì²éÀú³ÌÊÇ·ñ±£´æ£º

  ps aux | grep script.sh

µÇ¼ºó¸´ÖÆ

ÈôÊÇÊä³öÖаüÀ¨Óë½ÅÄÚÇé¹ØµÄÀú³Ì£¬ÔòÌåÏÖÀú³Ì±£´æ¡£

2¡¢Ê¹ÓÃpgrepÏÂÁpgrepÏÂÁî¿ÉÒÔͨ¹ýÀú³ÌµÄÃû³Æ²éÕÒÆäÀú³ÌID¡£Äã¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÀ´¼ì²é¾ç±¾Àú³ÌÊÇ·ñ±£´æ£º

 pgrep -f script.sh

µÇ¼ºó¸´ÖÆ

ÈôÊÇÏÂÁî·µ»ØÒ»¸öÀú³ÌID£¬ÔòÌåÏÖÀú³Ì±£´æ¡£

3¡¢Ê¹ÓÃpidofÏÂÁpidofÏÂÁî¿ÉÒÔͨ¹ýÀú³ÌµÄÃû³ÆÖ±½Ó²éÕÒÀú³ÌID¡£Äã¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÀ´¼ì²é¾ç±¾Àú³ÌÊÇ·ñ±£´æ£º

  pidof script.sh

µÇ¼ºó¸´ÖÆ

ÈôÊÇÏÂÁî·µ»ØÒ»¸öÀú³ÌID£¬ÔòÌåÏÖÀú³Ì±£´æ¡£

ƾ֤ÏêϸÇéÐΣ¬Ñ¡ÔñÊʺϵÄÒªÁìÀ´¼ì²é¾ç±¾Àú³ÌÊÇ·ñ±£´æ¡£ÕâЩҪÁìÒ²¿ÉÒÔͨ¹ý±à³ÌÓïÑÔ£¨ÈçC¡¢Python£©µÄϵͳŲÓûò¿âº¯ÊýÀ´ÊµÏÖ¡£

ÒÔÉϾÍÊÇlinuxÔõÑùÉó²é¾ç±¾Àú³ÌÊÇ·ñ±£´æµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí£¬°æȨÕùÒéÓë±¾Õ¾Î޹أ¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿­Ê±¹ÙÍøµÇ¼ÂËÓÍ»úÍø¹Ù·½Ì¬¶È£¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ£¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢£¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢£¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎ壬9:30-18:30£¬½ÚãåÈÕÐÝÏ¢

QR code
ÍøÕ¾µØͼ