LinuxÏÂÁÉó²ételnetÀú³ÌÊýÄ¿µÄÒªÁì
LinuxÏÂÁîÊÇϵͳÖÎÀíÔ±Ò»Ñùƽ³£ÊÂÇéÖбز»¿ÉÉٵŤ¾ßÖ®Ò»£¬ËüÃÇ¿ÉÒÔ×ÊÖúÎÒÃÇÍê³ÉÖÖÖÖϵͳÖÎÀíʹÃü¡£ÔÚÔËάÊÂÇéÖУ¬ÓÐʱ¼äÐèÒªÉó²éϵͳÖÐij¸öÀú³ÌµÄÊýÄ¿ÒÔ±ãʵʱ·¢Ã÷ÎÊÌâºÍ¾ÙÐе÷ÓÅ¡£±¾ÎĽ«ÏÈÈÝÔõÑùʹÓÃLinuxÏÂÁîÉó²ételnetÀú³ÌµÄÊýÄ¿£¬ÈÃÎÒÃÇÒ»ÆðÀ´Ñ§Ï°°É¡£
ÔÚLinuxϵͳÖУ¬ÎÒÃÇ¿ÉÒÔʹÓÃpsÏÂÁîÍŽágrepÏÂÁîÀ´Éó²ételnetÀú³ÌµÄÊýÄ¿¡£Ê×ÏÈ£¬ÎÒÃÇÐèÒª·¿ªÖնˣ¬ÊäÈëÒÔÏÂÏÂÁ
ps -ef | grep telnet | grep -v grep | wc -l
µÇ¼ºó¸´ÖÆ
ÏÂÃæÊǶÔÉÏÊöÏÂÁîµÄÚ¹ÊÍ£º
ps -ef£ºÁгöϵͳÖÐËùÓÐÀú³ÌµÄÐÅÏ¢£»
grep telnet£º¹ýÂ˳ö°üÀ¨¡°telnet¡±Òªº¦×ÖµÄÀú³ÌÐÅÏ¢£»
grep -v grep£ºÉ¨³ýµôgrepÏÂÁî×Ô¼º±¬·¢µÄÀú³ÌÐÅÏ¢£¬×èÖ¹ÔÚ¼ÆÊýʱ·ºÆð¹ýʧ£»
wc -l£ºÍ³¼ÆÇкÏÌõ¼þµÄÀú³ÌÊýÄ¿¡£
ͨ¹ýÖ´ÐÐÒÔÉÏÏÂÁ¼´¿ÉÉó²éÄ¿½ñϵͳÖÐtelnetÀú³ÌµÄÊýÄ¿¡£
ÁíÍ⣬ÎÒÃÇ»¹¿ÉÒÔʹÓÃpgrepÏÂÁîÀ´²éÕÒÌض¨Àú³ÌµÄPID£¨Àú³ÌID£©£¬È»ºóÔÙͳ¼ÆÊýÄ¿¡£Ê¾Àý´úÂëÈçÏ£º
pgrep -c telnet
µÇ¼ºó¸´ÖÆ
ÉÏÊöÏÂÁîÖУ¬-cÑ¡ÏîÌåÏÖÖ»ÏÔʾÇкÏÌõ¼þµÄÀú³ÌÊýÄ¿¡£
³ýÁËÒÔÉÏÏÈÈݵÄÒªÁ죬»¹¿ÉÒÔÍŽáÆäËûLinuxÏÂÁÈçps aux¡¢awkµÈ£¬À´ÊµÏÖÉó²ételnetÀú³ÌÊýÄ¿µÄ¹¦Ð§¡£
×ÜÖ®£¬ÊìÁ·ÕÆÎÕLinuxÏÂÁî¹ØÓÚϵͳÖÎÀíÔ±À´ËµÊǺÜÊÇÖ÷ÒªµÄ¡£Í¨¹ý±¾ÎÄÏÈÈݵÄÒªÁ죬ϣÍûÄÜ×ÊÖú¸÷ÈËÔ½·¢Àû±ãµØÉó²ételnetÀú³ÌµÄÊýÄ¿£¬Ìá¸ßϵͳÖÎÀíЧÂÊ¡£ÈôÊÇÏëÒªÏàʶ¸ü¶àLinuxÏÂÁîµÄÓ÷¨£¬¿ÉÒÔ²éÔÄÏà¹ØÎĵµ»òÕß¼ÓÈëÏà¹ØÅàѵ¿Î³Ì¡£Ô¸¸÷ÈËÔÚÊÂÇéÖж¼ÄÜ˳Ëì¸ßЧµØÍê³É¸÷ÏîʹÃü£¡
ÒÔÉϾÍÊÇLinuxÏÂÁÉó²ételnetÀú³ÌÊýÄ¿µÄÒªÁìµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡