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

linuxÔõô½¨ÉèĿ¼

ÔÚ linux ϵͳÖÐ £¬¿ÉÒÔʹÓÃÒÔÏÂ5ÖÖÒªÁ콨ÉèĿ¼£ºmkdir ÏÂÁîmkdir -p Ñ¡ÏîʹÓÃÊ÷Ðνṹxargs ÏÂÁîfind ÏÂÁî

ÔõÑùʹÓà Linux ½¨ÉèĿ¼

ÔÚ Linux ϵͳÖÐ £¬½¨ÉèĿ¼ÊÇÒ»¸ö³£¼ûµÄ²Ù×÷ £¬¿ÉÒÔͨ¹ýÒÔÏÂÒªÁìʵÏÖ£º

1. ʹÓà mkdir ÏÂÁî

mkdir ÏÂÁîÊÇ×î³£ÓõĽ¨ÉèĿ¼ÏÂÁî¡£ÆäÓï·¨ÈçÏ£º

mkdir [Ñ¡Ïî] Ŀ¼Ãû

µÇ¼ºó¸´ÖÆ

ÀýÈç £¬Òª½¨ÉèÃûΪ “my_directory” µÄĿ¼ £¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ

mkdir my_directory

µÇ¼ºó¸´ÖÆ

2. ʹÓà -p Ñ¡Ïî

-p Ñ¡Ïî¿ÉÒÔ½¨Éè²»±£´æµÄ¸¸Ä¿Â¼¡£ÀýÈç £¬Òª½¨ÉèÃûΪ “my_directory/sub_directory” µÄĿ¼ £¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ

mkdir -p my_directory/sub_directory

µÇ¼ºó¸´ÖÆ

3. ʹÓÃÊ÷Ðνṹ

ÒªÒ»´ÎÐÔ½¨Éè¶à¸öĿ¼²ã¼¶ £¬¿ÉÒÔʹÓÃÊ÷Ðνṹ¡£ÀýÈç £¬Òª½¨ÉèÃû³ÆΪ “my_directory/sub_directory/sub_sub_directory” µÄĿ¼½á¹¹ £¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ

mkdir -p my_directory/{sub_directory,sub_sub_directory}

µÇ¼ºó¸´ÖÆ

4. ʹÓà xargs ÏÂÁî

xargs ÏÂÁî¿ÉÒÔ½«Ò»ÏµÁÐÃû³ÆÓÃ×÷ÁíÒ»¸öÏÂÁîµÄ²ÎÊý¡£ÀýÈç £¬Òª½¨ÉèÒ»×éÃûΪ “directory1″¡¢”directory2” ºÍ “directory3” µÄĿ¼ £¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ

echo directory1 directory2 directory3 | xargs mkdir

µÇ¼ºó¸´ÖÆ

5. ʹÓà find ÏÂÁî

find ÏÂÁî¿ÉÒÔËÑË÷ºÍ½¨Éè²»±£´æµÄĿ¼¡£ÀýÈç £¬Òª½¨ÉèÃûΪ “my_directory” µÄĿ¼ £¬ÈôÊǸÃĿ¼²»±£´æ £¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ

find . -type d -name my_directory -o -exec mkdir my_directory \;

µÇ¼ºó¸´ÖÆ

×¢ÖØ£º

½¨ÉèĿ¼ÐèÒª¶ÔÄ¿µÄĿ¼µÄ¸¸Ä¿Â¼¾ßÓÐдȨÏÞ¡£

Ŀ¼Ãû²»¿É°üÀ¨ÌØÊâ×Ö·û £¬Èç “/”£¨Ð±¸Ü£©¡£

ʹÓà -v Ñ¡Ïî¿ÉÒÔÏÔʾ½¨ÉèĿ¼µÄÏêϸÀú³Ì¡£

ÒÔÉϾÍÊÇlinuxÔõô½¨ÉèĿ¼µÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

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

Ïà¹ØÐÂÎÅ

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

13452372176

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

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

QR code
ÍøÕ¾µØͼ