欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

mv,Directory not empty不能目錄覆蓋

系統 2427 0
    一。
    
mv /test1/* /test2/test1
rm -rf /test1

二。

You can however use rsync with the --remove-source-files option (and possibly others) to merge one directory into another.

rsync won't delete any directories, so you will have to do something like find -type d -empty -delete afterwards to get rid of the empty source directory tree.

  

?

    
      rsync -av /source/ /destination/

(after checking)

rm -rf /source/
      


--remove-source-files has the advantage of only removing files that were transferred successfully,
so you can use find to remove empty directories and will be left with everything that wasn't transferred without having to check rsync s output

    
      cd source; find -type f | xargs -n 1 -I {} mv {} dest/{}


    
  
    
      
        

三。

I'd recommend these four steps:

      
        cd ${SOURCE}; 

find . -type d -exec mkdir -p ${DEST}/\{} \; 

find . -type f -exec mv \{} ${DEST}/\{} \; 

find . -type d -empty -delete


      
    

or better yet, here's a script that implements semantics similar to mv :

      
        #!/bin/bash



DEST=${@:${#@}}; for SRC in ${@:1:$(({#@} -1))}; do   (

    cd $SRC;

    find . -type d -exec mkdir -p ${DEST}/\{} \; 

    find . -type f -exec mv \{} ${DEST}/\{} \; 

    find . -type d -empty -delete

) done


      
    
    
      
        

Here is a script that worked for me. I prefer mv over rsync, so I use Jewel and Jonathan Mayer's solutions.

              
                #!/bin/bash



# usage source1 .. sourceN dest



length=$(($#-1))

sources=${@:1:$length}

DEST=$(readlink -f ${!#})

for SRC in $sources; do

    pushd $SRC;

    find . -type d -exec mkdir -p ${DEST}/{} \;

    find . -type f -exec mv {} ${DEST}/{} \;

    find . -type d -empty -delete

    popd
              
            
    
      
        


if you use use mv --backup=numbered
(or one of the other options for the --backup switch),
then mv will complete the merge and preserve the files intended to be overwritten

mv,Directory not empty不能目錄覆蓋


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 一级黄色毛片视频 | 天天射天| 日韩在线国产精品 | 中文字幕三区 | 午夜资源站 | 国产成人综合久久 | 亚洲免费视频一区 | 一级一级一级一级毛片 | 视频精品一区 | 国产视频日本 | 亚洲欧美日韩精品久久奇米色影视 | 欧美激情专区 | 伊人久久精品成人网 | 日本黄 色 成 年 人免费观看 | 国产婷婷精品av在线 | 欧美大片在线免费观看 | 色综合久久中文字幕综合网 | 亚洲性人人天天夜夜摸 | 天天天天天天操 | 国产高清www免费视频 | 婷婷在线网 | 成人欧美日韩视频一区 | 91av导航| 天堂福利电影 | 激情丁香开心久久综合 | 亚欧成人中文字幕一区 | 99re3| 日韩欧美一区二区三区不卡在线 | 欧美日韩国产综合视频在线看 | 免费观看黄色a一级视频播放 | 成人性生交大片 | 91精品国产91久久久久久 | 日本加勒比视频在线观看 | 欧美成人激情视频 | 亚洲视频免费在线播放 | 午夜资源在线 | 中国美女一级黄色片 | 国产激情在线观看 | 波多野结衣三区 | 亚洲欧美国产另类视频 | 青青久草 |