×ðÁú¿­Ê±

linuxÉó²éÀú³ÌÊÇÄĸö³ÌÐò

ʹÓà linux ÏÂÁîÉó²éÀú³Ì¶ÔÓ¦µÄ³ÌÐò£ºÊ¹Óà “ps” ÏÂÁps -e -o comm=£¬ÏÔʾËùÓÐÀú³ÌµÄÏÂÁîÃû³Æ¡£Ê¹Óà “/proc” Îļþϵͳ£ºcat /proc/pid/cmdline£¬ÆäÖÐ “pid” ÊÇÀú³Ì id£¬ÏÔʾÀú³ÌÏÂÁîÐвÎÊý£¨°üÀ¨³ÌÐò·¾¶£©¡£

ÔõÑùʹÓà Linux ÏÂÁîÉó²éÀú³Ì¶ÔÓ¦µÄ³ÌÐò

ÒªÁì 1£ºÊ¹Óá°ps” ÏÂÁî

“ps” ÏÂÁîÁгöÄ¿½ñϵͳÕýÔÚÔËÐеÄÀú³Ì¡£

Ñ¡Ïî “-e” ÏÔʾËùÓÐÀú³Ì¡£

Ñ¡Ïî “-o comm=”½öÏÔʾÀú³ÌÏÂÁîÃû³Æ¡£

ÏÂÁîʾÀý£º

ps -e -o comm=

µÇ¼ºó¸´ÖÆ

ÒªÁì 2£ºÊ¹Óá°/proc¡±Îļþϵͳ

“/proc” Îļþϵͳ°üÀ¨ÓйØϵͳÖÐÿ¸öÀú³ÌµÄÐÅÏ¢¡£

ÒÔÀú³Ì ID ×÷ΪĿ¼ÃûµÄĿ¼°üÀ¨¸ÃÀú³ÌµÄÏêϸÐÅÏ¢¡£

Îļþ “cmdine” ´æ´¢ÁËÀú³ÌÏÂÁîÐвÎÊý£¬°üÀ¨³ÌÐò·¾¶¡£

ÏÂÁîʾÀý£º

cat /proc/PID/cmdline

µÇ¼ºó¸´ÖÆ

ÆäÖÐ “PID” ÊÇÒªÉó²éÆä³ÌÐòµÄÀú³Ì ID¡£

ÔõÑù»ñÈ¡Àú³Ì ID

ʹÓà “ps” ÏÂÁѡÏî “-p” Ö¸¶¨Àú³Ì ID£º

ps -p PID

µÇ¼ºó¸´ÖÆ

ʹÓà “pgrep” ÏÂÁָ¶¨³ÌÐòÃû³Æ£º

pgrep program-name

µÇ¼ºó¸´ÖÆ

ʾÀý

ÒªÉó²éÀú³Ì ID Ϊ 1234 µÄÀú³Ì¶ÔÓ¦µÄ³ÌÐò£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ

ÒªÁì 1£º”ps” ÏÂÁî

ps -p 1234 -o comm=

µÇ¼ºó¸´ÖÆ

ÒªÁì 2£º”/proc” Îļþϵͳ

cat /proc/1234/cmdline

µÇ¼ºó¸´ÖÆ

Õ⽫Êä³ö¸ÃÀú³ÌµÄÏÂÁîÐвÎÊý£¬ÆäÖаüÀ¨³ÌÐò·¾¶¡£

ÒÔÉϾÍÊÇlinuxÉó²éÀú³ÌÊÇÄĸö³ÌÐòµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

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

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±

18523999891

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

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

QR code
¡¾ÍøÕ¾µØͼ¡¿¡¾sitemap¡¿