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

linux¹ÜµÀÏÂÁîÔõô´ò

¹ÜµÀÏÂÁîÔÚ linux ÖÐͨ¹ý¹ÜµÀ·û£¨|£©½¨Éè £¬Ê¹Ò»¸öÏÂÁîµÄÊä³ö³ÉΪÁíÒ»¸öÏÂÁîµÄÊäÈë¡£ÀýÈç £¬ls | grep .txt ½«ÁгöÒÔ .txt ×îºóµÄÎļþ¡£¹ÜµÀÖеĶà¸öÏÂÁî¿É½«Êä³ö×÷ΪºóÐøÏÂÁîµÄÊäÈë £¬ÀýÈç £¬ls | grep .txt | wc -l ͳ¼ÆÒÔ .txt ×îºóµÄÎļþÊýÄ¿¡£¹ÜµÀ¿Éת´ïÑ¡Ïî £¬Èç ls -l | grep .txt ÒÔÊúÏßÍÑÀëÊä³ö¡£×¢ÖØ £¬¹ÜµÀ½öת´ï±ê×¼Êä³öµ½±ê×¼ÊäÈë £¬ÐèÈ·±£¼æÈÝÐÔÒÔʵÏÖÏÂÁî×Ô¶¯»¯¡£

Linux ¹ÜµÀÏÂÁ

¹ÜµÀÏÂÁîÊÇÒ»ÖÖ½«Ò»¸öÏÂÁîµÄÊä³ö×÷ΪÁíÒ»¸öÏÂÁîµÄÊäÈëµÄ»úÖÆ¡£ÔÚ Linux ÖÐ £¬Ê¹ÓùܵÀ·û£¨|£©À´½¨Éè¹ÜµÀ¡£

½¨Éè¹ÜµÀ£º

Òª½¨Éè¹ÜµÀ £¬ÇëʹÓÃÒÔÏÂÓï·¨£º

command1 | command2

µÇ¼ºó¸´ÖÆ

ÀýÈç £¬ÒÔÏÂÏÂÁ ls ÏÂÁîµÄÊä³ö×÷Ϊ grep ÏÂÁîµÄÊäÈ룺

ls | grep .txt

µÇ¼ºó¸´ÖÆ

Õ⽫ÁгöÄ¿½ñĿ¼ÖÐËùÓÐÒÔ .txt ×îºóµÄÎļþ¡£

¹ÜµÀÖеĶà¸öÏÂÁ

¿ÉÒÔͨ¹ý½«¶à¸öÏÂÁîÓùܵÀ·ûÅþÁ¬ÆðÀ´ £¬ÔڹܵÀÖн¨Éè¶à¸öÏÂÁî¡£ÀýÈç £¬ÒÔÏÂÏÂÁ ls ÏÂÁîµÄÊä³ö×÷Ϊ grep ÏÂÁîµÄÊäÈë £¬²¢½« grep ÏÂÁîµÄÊä³ö×÷Ϊ wc ÏÂÁîµÄÊäÈ룺

ls | grep .txt | wc -l

µÇ¼ºó¸´ÖÆ

Õ⽫ͳ¼ÆÄ¿½ñĿ¼ÖÐÒÔ .txt ×îºóµÄÎļþµÄÊýÄ¿¡£

¹ÜµÀÖеÄÑ¡Ï

¿ÉÒÔÏò¹ÜµÀÖеÄÏÂÁîת´ïÑ¡Ïî¡£ÀýÈç £¬ÒÔÏÂÏÂÁ ls ÏÂÁîµÄÊä³öÒÔÊúÏßÍÑÀëµÄÃûÌÃ×÷Ϊ grep ÏÂÁîµÄÊäÈ룺

ls -l | grep .txt

µÇ¼ºó¸´ÖÆ

×¢ÖØÊÂÏ

¹ÜµÀÖ»Äܽ«±ê×¼Êä³öת´ï¸ø±ê×¼ÊäÈë¡£

È·±£ÏÂÁîµÄÊä³öÓëÊäÈëÏÂÁîËùÐèµÄÊäÈëÀàÐͼæÈÝ¡£

¹ÜµÀÏÂÁîÊÇÒ»¸öÇ¿Ê¢µÄ¹¤¾ß £¬¿ÉÒÔÓÃÓÚÖ´ÐÐÖØ´óµÄʹÃü×Ô¶¯»¯¡£

ÒÔÉϾÍÊÇlinux¹ÜµÀÏÂÁîÔõô´òµÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

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

Ïà¹ØÐÂÎÅ

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

18523999891

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

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

QR code
ÍøÕ¾µØͼ