ÖØÐÂѧÆð£ºÕÆÎÕLinuxÏÂÁîÖеÄͨÅä·û
ÖØÐÂѧÆð£ºÕÆÎÕLinuxÏÂÁîÖеÄͨÅä·û
ÔÚLinuxϵͳÖУ¬Í¨Åä·ûÊÇÒ»ÖÖÓÃÓÚÆ¥ÅäÎļþÃûµÄÌØÊâ×Ö·û¡£ÕÆÎÕÕâЩͨÅä·û¿ÉÒÔ×ÊÖúÎÒÃǸü¸ßЧµØÔÚÏÂÁîÐÐÖж¨Î»ºÍ²Ù×÷Îļþ¡£±¾ÎĽ«ÖصãÏÈÈݼ¸ÖÖ³£ÓõÄLinuxͨÅä·û£¬²¢¸½´øÏêϸµÄ´úÂëʾÀý£¬Ï£Íû¿ÉÒÔ×ÊÖú³õѧÕ߸üºÃµØÃ÷È·ºÍÔËÓÃÕâЩͨÅä·û¡£
1. ÐǺţ¨*£©
ÐǺÅͨÅä·û´ú±íÁã¸ö»ò¶à¸öí§Òâ×Ö·û£¬¿ÉÒÔÆ¥Åäí§ÒⳤµÄ×Ö·û´®¡£ÏÂÃæÊÇÒ»¸öÀý×Ó£º
ls *.txt
µÇ¼ºó¸´ÖÆ
ÉÏÊöÏÂÁî»áÁгöÄ¿½ñĿ¼ÏÂËùÓÐÒÔ.txt×îºóµÄÎļþ¡£
2. Îʺţ¨?£©
ÎʺÅͨÅä·û´ú±íÒ»¸öí§Òâ×Ö·û£¬¿ÉÒÔÓÃÀ´Æ¥Åäµ¥¸ö×Ö·û¡£Ê¾Àý£º
ls file?.txt
µÇ¼ºó¸´ÖÆ
ÉÏÃæµÄÏÂÁî»áÁгöÎļþÃûΪfile1.txt¡¢file2.txtµÈµÄÎļþ¡£
3. ÖÐÀ¨ºÅ£¨[]£©
ÖÐÀ¨ºÅͨÅä·ûÓÃÓÚÆ¥ÅäÖ¸¶¨¹æÄ£ÄÚµÄ×Ö·û¡£ÀýÈ磬ҪƥÅäí§ÒâÒ»¸öÊý×Ö£¬¿ÉÒÔʹÓãº
ls file[0-9].txt
µÇ¼ºó¸´ÖÆ
ÉÏÊöÏÂÁî»áÁгöÎļþÃûΪfile0.txt¡¢file1.txtµÈµÄÎļþ¡£
4. »¨À¨ºÅ£¨{}£©
»¨À¨ºÅͨÅä·ûÓÃÓÚÌìÉú¶à¸ö×Ö·û´®µÄ×éºÏ¡£ÀýÈ磬ÈôÊÇҪͬʱ²Ù×÷file1.txtºÍfile2.txtÕâÁ½¸öÎļþ£¬¿ÉÒÔʹÓãº
cp file{1,2}.txt new_directory/
µÇ¼ºó¸´ÖÆ
ÉÏÃæµÄÏÂÁî»á½«file1.txtºÍfile2.txt¸´ÖƵ½new_directory/Ŀ¼ÖС£
ÔÚÏÖʵӦÓÃÖУ¬ÍŽá¶àÖÖͨÅä·û¿ÉÒÔ¸üÎÞаµØÆ¥ÅäºÍ²Ù×÷Îļþ¡£ÀýÈ磬ҪÁгöËùÓÐÒÔ×Öĸ¿ªÍ·µÄ.txtÎļþ£¬¿ÉÒÔÍŽáʹÓÃÐǺźÍÖÐÀ¨ºÅͨÅä·û£º
ls [a-z]*.txt
µÇ¼ºó¸´ÖÆ
ÉÏÊöÏÂÁî»áÁгöÎļþÃûÒÔСд×Öĸ¿ªÍ·ÇÒÒÔ.txt×îºóµÄÎļþ¡£
ÔÚʹÓÃͨÅä·ûʱ£¬ÐèҪעÖØͨÅä·ûÕö¿ªµÄ˳ÐòºÍλÖã¬È·±£Æ¥Åäµ½ÆÚÍûµÄÎļþ¡£±ðµÄ£¬Í¨Åä·û»¹¿ÉÒÔÓÃÔÚÆäËûLinuxÏÂÁîÖУ¬Èçcp¡¢rmµÈ£¬×ÊÖú¾ÙÐÐÅúÁ¿²Ù×÷¡£
Ï£Íûͨ¹ý±¾ÎĵÄÏÈÈݺÍʾÀý£¬¶ÁÕßÄܹ»¸üºÃµØÃ÷È·ºÍÕÆÎÕLinuxÏÂÁîÖеÄͨÅä·û£¬Ìá¸ßÔÚÏÂÁîÐÐÖвÙ×÷ÎļþµÄЧÂÊ¡£Ï£Íû¶ÁÕß¿ÉÒÔÖØÐÂѧÆð£¬Ò»Ö±ÑµÁ·£¬¼ÓÉî¶ÔLinuxϵͳµÄÃ÷È·ºÍÓ¦Óá£
ÒÔÉϾÍÊÇÖØÐÂѧÆð£ºÕÆÎÕLinuxÏÂÁîÖеÄͨÅä·ûµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡